Git入门(五) 标签设置、配置别名

标签管理

发布一个版本,会先再版本库上打一个标签,这样就唯一确定了打标签时刻的版本,容易记住,跟其所指定的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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值