Git is a version management operation tool very n, can be very intelligent distributed management,
Installation
Yum-y Install git
Local Settings Global
Tell who submitted the code information
# git config--global"xxx"--global"xxx "
Color settings
# git config--global color.ui true
Initializing the Warehouse
# mkdir oldboy# cd Oldboy/ in
Submit a Code Flow
first create the file #cat readme.txt 1 hehe Adding # git add readme.txt " "[Master (Root-110 deletions (- 100644 Readme.txt View state #git Status
Fallback version
# git reset--hard head^ ^ indicates last version ^^ represents the last two versions of fallback specified version # git reflog8b1cc8f [email protected]{0} : head^: Updating head10c245e [email protected]{1}: Commit:add 2hehe8b1cc8f [Email protected]{
2}: commit:the 2th commit9ec14f1 [email protected]{3--is now at 9EC14F1 the first commit
Git checkout--readme.txt #从新拉取数据
Remote Warehouse
Create a repository on GitHub and then add the local public key to the Ssh-key in setting above GitHub
locally created secret # SSH-keygen-t RSA public key uploaded to setting set SSH key
#cd/root/oldboy#git Remote Add origin [email protected]:yefei520/demo.git#git pull#git Pull-u Origin Master
GitHub is relatively slow and public in foreign countries if you want to encrypt the money but there is open source Gitlab open source software can replace GitHub we open the next chapter how to install Gitlab
Git Version Management Basic operations