1.1Git Installation
CentOS on Yum install-y epel-release; yum install git
Ubuntu on Apt-get Install git
Install Msysgit on Windows
Https://git-for-windows.github.io
After the installation is complete, you will need to set the final step
git config--global user.name "Your name"//For example Snale
git config--global user.email "[email protected]"//Own Mailbox
Note that the parameters of the git config
command, --global
using this parameter, means that all of your git repositories on this machine will use this configuration, of course, you can also assign a different user name and email address to a warehouse.
1.2 Creating a warehouse push file
Mkdir/data/gitroot
Cd/data/gitroot
GIT init//Initialize with this command to make this directory a repository that git can manage
List-a can see a more. Git directory
Echo-e "123\nsnale\ngittest" >gittest.txt
git add gittest.txt//adding files to the Warehouse
Git commit-m "Add test file Gittest.txt"//add must commit in order to actually commit the file to the warehouse
Echo-e "11111\n222222" >>gittest.txt//Change file
git status//view the status in the current repository, such as whether there are any changes to the file
git diff gittest.txt//Can compare the version of the repository with the gittest.txt compared to what is changed this time
Distributed code Management System git