git rev-parse介绍;获取commit id

git rev-parse master^{commit} 是什么意思

显示master提交的SHA1值

if you want to make sure that the output actually names an object in your object database and/or can be used as a specific type of object you require, you can add the ^{type} peeling operator to the parameter. For example, git rev-parse "$VAR^{commit}" will make sure $VAR names an existing object that is a commit-ish (i.e. a commit, or an annotated tag that points at a commit). To make sure that $VAR names an existing object of any type, git rev-parse "$VAR^{object}" can be used.

git rev-parse –-git-dir

显示版本库.git目录所在的位置

git rev-parse –-show-toplevel

显示工作区根目录

git rev-parse –-show-prefix

显示相对于工作区根目录的相对路径

git rev-parse –-show-cdup

显示从当前目录(cd)后退(up)到工作区的根目录的深度

git rev-parse --symbolic –-branches

https://git-scm.com/docs/git-rev-parse

show branch refs found in refs/heads/

git rev-parse –-symbolic –-tags

获取完整commit id(如:bb4f92a7d4cbafb67d259edea5a1fa2dd6b4cc7a)

git rev-parse HEAD

获取short commit id(如:bb4f92a)

git rev-parse --short HEAD

这里的rev应该是revision(修订/版本)的缩写

show tag refs found in refs/tags/

转载于:https://www.cnblogs.com/shengulong/p/11502603.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值