标签管理
发布一个版本,会先再版本库上打一个标签,这样就唯一确定了打标签时刻的版本,容易记住,跟其所指定的commit绑在一起
创建一个新标签
git tag v1.0
查看所有标签
git tag
查找历史提交的commit id
git log --pretty=oneline --abbrev-commit
对指定的提交打标签
git tag v1.2 ec14609
查看标签信息
git show v1.3
Tagger: wh_xiasm <489572105@qq.com>
Date: Fri Aug 17 15:30:56 2018 +0800
新版本1.1
commit c070e97598f682b3565c4dc3692987acbddbe35c (HEAD -> master, tag: v1.3, origin/master)
Merge: ec14609 ad10d6b
Author: wh_xiasm <489572105@qq.com>
Date: Fri Aug 17 11:47:27 2018 +0800
conflict...
diff --cc readme.txt
index 2e17381,645caad..054518d
--- a/readme.txt
+++ b/readme.txt
@@@ -3,5 -3,5 +3,6 @@@ Git is free software under the GPL
XXXX.
create a new branch is simple and interest.
创建带有说明的标签,用-a指定签名 -m指定说明文字
git tag -a v1.3 -m “新版本1.3” 1082ewe
删除标签:
git tag -d v1.1
推送某个标签:
git push origin v1.1
推送所有未推送的标签:
git push origin --tags
删除远程标签
git push origin :refs/tags/v1.3
配置别名
git config --global alias st status
git st
On branch master
Your branch is up to date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
bootstrap/
git001/
nothing added to commit but untracked files present (use "git add" to track)
果然与git status等效
如果想删掉别名直接进入.gitconfig删除即可(删掉st =status)
[user]
name = wh_xiasm
email = 489572105@qq.com
[alias]
st = status