git怎么查询当前分支的版本号(commit id)

类似SVN中的命令:svn info -r BASE "d:/project/Coding"

我现在想知道在git中有没有类似的命令可以得到commit id

跪谢!

阅读 94.9k
6 个回答

git rev-parse HEAD

新手上路,请多包涵

git log。可以看很多

git log --pretty=oneline

git log或者git reflog都能看到

两个命令均可以,如同 @云语2019 所说:

#git reflog 
git log --pretty =oneline

结果如下:

69e1506ad9fed9771b9f7d1e478ac2ff05fc3604 Add git user profile functions for prompt display
c4582777fc50162d8b433cabad34f629b0ea9b98 Merge pull request #4957 from TorrentKatten/master
e8a9d0ee1a97033fb4aa371263889b77200b6d62 localization support for clock in candy theme
c3b3de5f29b72b45393b62d794450ad3a72703a8 Merge pull request #4956 from RobLoach/asdf
616ac67924212df2f75139c94ca323f13f249dc6 Add 'asdf' plugin

git log --graph

推荐问题
宣传栏