標籤管理
發佈一個版本,會先再版本庫上打一個標籤,這樣就唯一確定了打標籤時刻的版本,容易記住,跟其所指定的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 <[email protected]>
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 <[email protected]>
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 = [email protected]
[alias]
st = status