1 Installing Git
Copy Code code as follows:
$ sudo aptitude install git
$ sudo aptitude install Git-doc git-svn git-email Git-gui
The GIT package contains most of the Git commands, is a mandatory package, and the second line is a git package, but it is published separately and optionally installed.
2 Download the remote Project git library to the local
[Code]
$ git clone git://remote git library address filename
[Code]
FileName is your local folder name. Clones the remote library to this folder, which was created by yourself
3 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" submits your current development to registers, which can be understood as your local git library
(6) Git pull update, if several people at the same time on the development of a branch, may cause a different step, causing their own local git library behind or remote Git library, it is necessary to update their own local library.
(7) Git push commits, submits the code which oneself develops to the corresponding remote cent to go up
(8) Git Status View the workspace status and see what's done on this branch
(9) Git log to see the operation logs, or very useful
(Ten) Git merge merged branch, the module that oneself develops finally wants to merge to the total branch of the project, this is to switch first to the project general branches, then git merges own branch
(one) git branch-d/d yourbranch Delete local branch
(in) Git push origin:yourbranch Remove remote branch