Recently, I used git for version control. I found that git has many commands, so I can write down some common commands for viewing. The following content is a summary of this article, which is quite good. Let's take a look.
Certificate ------------------------------------------------------------------------------------------------------------------------------------------
1) remote warehouse commands
Check out Repository: $ git clone git: // github.com/jquery/jquery.git
View remote Repository: $ git remote-V add remote Repository: $ git remote add [name] [url] Delete remote Repository: $ git remote RM [name] Pull remote Repository: $ git pull [remotename] [localbranchname] Push remote Repository: $ git push [remotename] [localbranchname]
2) branch operation commandsView local branch: $ git branch view remote branch: $ git branch-r create local branch: $ git branch [name] ---- note that after the new branch is created, it will not automatically switch to the current Branch: $ git checkout [name] Create a new branch and immediately switch to the new branch: $ git checkout-B [name] Delete the branch: the $ git branch-d [name] -----D option can only delete the branches that have already been merged. To forcibly delete a branch, use the-D option to merge the branch: $ git merge [name] ---- merge the branch named [name] with the current branch to create a remote Branch (push local branch to remote ): $ git push origin [name] Delete remote branch: $ git push origin: heads/[name]
3) version (TAG) related commandsView version: $ git tag created version: $ git tag [name] Delete version: $ git tag-d [name] view remote version: $ git tag-r create remote version (local version push to remote): $ git push origin [name] Delete remote version: $ git push origin: refs/tags/[name]
4) submodule related operation commandsAdd sub-module: $ git submodule add [url] [path] initialize sub-module: $ git submodule init ---- update the sub-module only once when the first warehouse is detected: $ git submodule update ---- run the following command to delete the sub-module after each update or switch branch: $ git Rm -- cached [path]
5) Ignore some files and folders and do not submit them.Create a file named ". gitignore" in the root directory of the repository and write the folder name or file that is not required. Each element occupies one row, for example, targetbin *. DB.
This article from: http://hi.baidu.com/hk2305621/blog/item/fe23cc864685ca34c75cc3a3.html
Certificate ------------------------------------------------------------------------------------------------------------------------------------------
For more information, see:
Http://blog.163.com/evan__zhang@yeah/blog/static/12103275720096204235185/