ITeye博客

git tags 使用 远程创建git tags 删除(小抄版)

夜鸣猪 · 2012-08-01 21:13 · Ruby On Rails · 编程语言 · Markdown

Reference

update 0.5 获取远程tag


#my_abc是tag号
git clone http://git.abc.net/git/abc.git
git checkout my_abc OR git checkout -b new_branch my_abc

update v2 获取远程tag or branch code="java"]$ git ls-remote --heads origin

5b3f7563ae1b4a7160fda7fe34240d40c5777dcd refs/heads/1-2-stable 71926912a127da29530520d435c83c48778ac2b2 refs/heads/2-0-stable 2b158543247a150e8ec568becf360e7376f8ab84 refs/heads/2-1-stable b0792a3e7be88e3060af19bab01cd3d26d347e4c refs/heads/2-2-stable d6b9f8410c990b3d68d1970f1461a1d385d098d7 refs/heads/3-0-unstable f04346d8b999476113d5e5a30661e07899e3ff80 refs/tags/v0.13.3


git pull origin refs/tags/v0.13.3
git pull origin refs/heads/2-2-stable

创建

  1. 本地创建tags
git tag -a v1.1 -m "new release"

1.5 查看本地tags

git tag -l
  1. push到服务器端

git push --tags

2.2.1 创建和删除远程branch

git push origin head:newbranch_name 
git push origin head:feature/newbranch_name   

#删除远程分支,其它开发者要git branch -d -r 分支  
git push origin :newbranch_name  

2.3 删除本地tag

git tag -d v1.1
  1. 删除服务器端远程tag
git push origin :refs/tags/v1.1
  1. 查看远程服务器端
$ git remote show origin
  • remote origin URL: git://github.com/rails/rails.git Remote branch merged with 'git pull' while on branch master master Tracked remote branches 1-2-stable 2-0-stable 2-1-stable 2-2-stable 3-0-unstable master
$ git ls-remote --heads origin

5b3f7563ae1b4a7160fda7fe34240d40c5777dcd refs/heads/1-2-stable 71926912a127da29530520d435c83c48778ac2b2 refs/heads/2-0-stable 2b158543247a150e8ec568becf360e7376f8ab84 refs/heads/2-1-stable b0792a3e7be88e3060af19bab01cd3d26d347e4c refs/heads/2-2-stable d6b9f8410c990b3d68d1970f1461a1d385d098d7 refs/heads/3-0-unstable f04346d8b999476113d5e5a30661e07899e3ff80 refs/heads/master

给同行个链接

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。