linuxサーバに独自のgitライブラリを配備し、IDEAのgitライブラリへのプロジェクトのアップロードを構成します.
linuxサーバにgitをインストールし、IDEAを自分のgitライブラリにアップロードするように構成します.
1) yum ( )
yum update
2) git( )
yum remove git -y
3)
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
#-bash: wget: command not found
yum -y install wget
4) Git
# git :https://www.kernel.org/pub/software/scm/git
wget https://www.kernel.org/pub/software/scm/git/git-2.11.1.tar.gz -P /usr/zhangqiang/git
cd /usr/zhangqiang/git && tar -zxvf git-2.11.1.tar.gz && cd git-2.11.1
5)
# prefix , —prefix 。
# , , ;
# ( )。
# configure( )[prefix configure ] make( ) make install( )
make prefix=/usr/git all && make prefix=/usr/git install
6) git
echo "export PATH=$PATH:/usr/git/bin" >> /etc/bashrc && source /etc/bashrc
#
vim /etc/bashrc
#
export PATH=/usr/git/bin:$PATH
source /etc/bashrc
7)
git --version( )
8)
git config --global user.name 'zhangqiang'
git config --global user.email '[email protected]'
9) git
useradd git
10) sudo
visudo || vi /etc/sudoers
# ,
git ALL=(ALL) NOPASSWD: ALL
11) git ssh-keygen -t rsa .ssh
12) git
mkdir sample.git
cd sample.git
# git --bare init :git init
# git init , , work tree, push ,
# push ( push , ), push work tree ,
# , git reset --hard push .
git --bare init
13) (windows) git https://git-scm.com/download/win
14) windows git bash
ssh-keygen -t rsa -C "[email protected]"
15) linux /home/git/.ssh/authorized_keys
sudo cat /usr/zhangqiang/id_rsa.pub >> /home/git/.ssh/authorized_keys
scp id_rsa.pub [email protected]:.ssh/authorized_keys
# :.ssh 700, authorized_keys 644
16) ssh
ssh [email protected]
17) IDEA Git
Settings(Ctrl+Alt+S) -> Version Control -> Git -> Path to Git executable git.exe
18) windows git bash
# git
git init
# git add . git , git ,
git add src # src
#
git commit -m "first commit"
#
git remote add origin [email protected]:/home/git/sample.git
#
git push -u origin master
# git
#
git pull --rebase origin master
# github down 。
git clone git@github.com:ellocc/gittest.git
#
git status
19) idea src( add git ), Git ,
20) git shell
vi /etc/passwd
git:x:501:501::/home/git:/bin/bash git:x:501:501::/home/git:/usr/git/bin/git-shell