1. Install dependent packages
sudo yum install curl-devel expat-devel gettext-developenssl-devel zlib-devel
sudo yum install libcurl4-gnutls-dev libexpat1-dev gettext Libz-dev Libssl-dev
2. Install git
Yum-y Install git
3. Create a project directory
mkdir Gitbase
CD Gitbase
4. Create a shared library
sudo git init
5. Clone repository: # git clone http://192.168.8.8/git/first.git6, create file and submit to local repository: # CD first# echo ' OK ' > readme.txt# git add Readme. txt# git commit-m ' first commit ' $ GIT push origin master attached: common commands
(1) Git branch view local branch
(2) Git branch-a View Remote branch
(3) Git checkout branchname Switch branch
(4) Git add yourfile
(5) Git commit-a-M "description" commits your current development to staging area, which can be understood as your local git library
(6) Git pull update, if several people at the same time in the development of a branch, may cause a different step, causing their own local git library behind or early remote Git library, this time to update their local library.
(7) Git push commits to commit the code you have developed to the corresponding remote
(8) Git Status View workspace status and see what's done on this branch
(9) Git log to view the operation log, it is very useful
Git merge Merge branch, the module that you developed will eventually be merged into the total branch of the project, which is to switch to the project master, then git merge its own branch
(one) git branch-d/d yourbranch Delete local branch
git push origin:yourbranch Delete remote Branch
git utility Commands Daquan reference http://www.linuxidc.com/Linux/2013-11/93338.htm
Common commands for Git in Linux