欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2024-03-20 09:20:34
...
[url=http://hlee.iteye.com/blog/669831]Reference[/url]


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[/code]
[quote]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[/quote]


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


2. 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


3. 删除服务器端远程tag

git push origin :refs/tags/v1.1


4. 查看远程服务器端

$ git remote show origin

[quote]* 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[/quote]

$ git ls-remote --heads origin

[quote]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[/quote]


给同行个[url=http://blog.ashchan.com/archive/2008/06/30/tags-on-git/]链接[/url]

上一篇: 一致性hash实现

下一篇: 5