git commit id相关

转自:https://blog.csdn.net/lonewolf521125/article/details/52192474/

          https://blog.csdn.net/liliang199/article/details/79236683

获取完整commit id(如:14123c8877e6ebdc220e205d92fc70feaf06dab1)

git rev-parse HEAD

获取short commit id(如:14123c8)

git rev-parse --short HEAD

 

查看给定git commid id 所影响的分支

commit id为 e378da35a9aef744d5b0dc9e89ea41905df93d0a

git branch --contains e378da35a9aef744d5b0dc9e89ea41905df93d0a

git clone指定commit id的版本

git clone -b branch git@github/$username/$project.git

git checkout commitid

 

你可能感兴趣的:(工具)