git 常用实例

Clone and Checkout

  1. clone远程仓库

  2. 删除远程分支

    git push origin --delete branchname

Tag

  1. 创建轻量级TAG

    git tag v-0.1

  2. 创建有附注的标签

    git tag -a v3.8rc -m "RC 3.8"

  3. 创建带签名的标签

    git tag -s v3.8rc -m "RC 3.8"

  4. 将标签v3.8rc推送到远程仓库orgin

    git push origin v3.8rc

  5. 将本地所有的标签都推送到远程仓库origin

    git push origin --tags

  6. 将标签v3.8rc 检出

    git checkcout -b NEWBRANCH v3.8rc

  7. 删除本地标签v0.1

    git tag -d v0.1

  8. 删除远程仓库上的标签k1.2.0

    git push origin --delete tag k1.2.0

Revert