Common git commands for creating, viewing, and deleting branches, creating, viewing, and deleting tags

Source: Internet
Author: User
Tags git commands

1. Git document https://github.com/progit/progit/blob/master/zh/02-git-basics/01-chapter2.markdownhttps://github.com/progit/progit/tree/master/zhhttp://www.uml.org.cn/pzgl/201204285.asp if it is a Windows operating system, you can install a visual version controller: Turtle. In this way, you do not need to run the GIT command. Small turtle installation configuration: http://blog.chinaunix.net/uid-25806493-id-3319781.htmlhttp://my.oschina.net/longxuu/blog/141699 2. Common commands: Branch, Tag, pull, fetch # Branch
git branch                        /*查看本地分支*/git checkout -b daily/1.0.0   /*签出新分支*/git checkout daily/1.0.1      /*切换到其他分支*/git push origin daily/1.0.0   /*push到远程分支*/git branch -d daily/1.0.0   /*删除本地分支*/git push origin --delete daily/1.0.0 /*删除远程分支*/
删除也可以这样:git push origin :branch-name
# Tag
git tag  /*查看本地tag*/git tag -d publish/1.0.0   /*删除本地tag*/git push origin --delete tag publish/1.0.0 /*删除远程tag*/

 

# Merge remote branches to local branches

git fetch origin daily/1.0.0  /*获取远程分支*/git merge origin daily/1.0.0  /*将本地分支与远程分支合并*/git pull origin daily/1.0.0     /*获取并合并远程分支到本地分支*/

 

Note: git pull is equivalent to obtaining the latest version from a remote device and merge to the local device. In actual use, git fetch is safer.
Because before merge, we can check the updates and then decide whether to merge them. 3. Common git steps
    • RunGit init
    • Git checkout-B daily/3.0.0/* Check out new branch */
    • Git add src/test. JS/* add to the temporary storage zone */
    • Git commit-M "your submission information"
    • Git merge master/* merge branches, which can not be done. If any other version is modified, merge */
    • Git push-u origin daily/3.0.0
    • Git tag publish/3.0.0/* tag */
    • Git push-u origin publish/3.0.0 release tag
    • Git pull origin daily/1.0.0/* merge remote branches and local branches */

Common git commands for creating, viewing, and deleting branches, creating, viewing, and deleting tags

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.