鍍金池/ 問答/Linux/ git rev-parse master^{commit} 是什么意思?!

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

git rev-parse refs/remotes/origin/master^{commit}

這里的 ^{master} 是啥意思?!在reset的時(shí)候^可是指代的上一版本???!

回答
編輯回答
不歸路

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.

在這里^{type}是指定類型的意思

2018年3月3日 22:21