Lennakim

I am lennakim

0%

git 用法

remote tag的用法总是记不住, 2015-03-10 有更新

Git-Remote

1
2
3
4
5
6
7
git remote add <shortname> <url> #新建远程仓库
git remote set-url origin <url>
git remote set-branches [--add] <name> <branch>
git remote set-url [--push] <name> <newurl> [<oldurl>]
git remote set-url --add <name> <newurl>
git remote set-url --delete <name> <url>

Git-Tag

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
git tag #列出标签

git tag v0.1.2-light 创建轻量标签

git tag -a v0.1.2 -m "0.1.2 Version" #创建附注标签

git push origin v0.1.2 # 将v0.1.2标签提交到git服务器

git push origin –tags # 将本地所有标签一次性提交到git服务器

git tag -d v0.1.2 # 删除标签

git show v0.1.2 # 用git show命令可以查看标签的版本信息

git tag -a v0.1.1 9fbc3d0 # 给指定的commit打标签


Update 2015-03-10

1
2
3
4
5
6
7
8
9
10
11
# 移动分支到某个 commit
git branch -f <branch> <commit>

# github reset br remote head
git reset --hard origin/<br-name>

#rename git branch
git branch -m <oldname> <newname>

# 修改当前分支
git branch -m <newname>

参考

http://blog.csdn.net/wangjia55/article/details/8793577
http://www.cnblogs.com/wang_yb/p/3867221.html