开发者

Checking out a project's first commit with git

开发者 https://www.devze.com 2023-01-08 05:11 出处:网络
Is there an easy way to find the SHA1 of the first commit in a project with a long history wit开发者_JAVA百科h git?Just off the top of my HEAD, this should get one of the \'first\' commits of the curr

Is there an easy way to find the SHA1 of the first commit in a project with a long history wit开发者_JAVA百科h git?


Just off the top of my HEAD, this should get one of the 'first' commits of the current branch.

git rev-list --reverse HEAD | head -1

(If the branch contiains two unrelated branches which have been merged together, it's not guaranteed which root you will get but you could use --date-order to select the oldest.)


git log --reverse | head -n1
0

精彩评论

暂无评论...
验证码 换一张
取 消