Git是什么?
Git是目前世界上最先进的分布式版本控制系统(没有之一)。
安装Git
首先确认系统是否安装git
[root@VM_189_160_centos ~]# git
-bash: git: command not found
Ubuntu高版本已安装,如果没有,则执行sudo apt-get install git -y
其他版本linux:https://git-scm.com/download/linux
CentOS版本:
下载:
1,查看最新版git:访问https://www.kernel.org/pub/software/scm/git/
或者https://github.com/git/git/releases
2、官网下载:
wget https://Github.com/Git/Git/archive/v2.17.0.tar.gz
下载完成后:
tar fx git-2.17.0.tar.gz
cd git-2.17.0
make configure
yum install tcl build-essential tk gettext -y
./configure --prefix=/usr/local/git --with-iconv --with-curl --with-expat=/usr/local/lib
make &&make install
echo “export PATH=$PATH:/usr/local/git/bin” >> /etc/bashrc
source /etc/bashrc
git --version
安装完成
git config --global user.name "xx"
git config --global user.email "xxx"
make xx
初始化git库
git init
[root@VM_189_160_centos talkcloud]# git init
Initialized empty Git repository in /root/xx/.git/
git add file
git commit -m "wrote a readme tile"
PS:-m后面输入的是本次提交的说明 ,可以输入任意内容
add可以提交多个文件,cmmit一次性提交