2017-01-09 45 views
-5

提交作者姓名/斌/庆典

git_log = git ls-remote git url master git_commitId = git_log!|切-d “” -f1 回波$ git_commitId 坎德拉/工作区 git_log_verify = git rev-parse HEAD 回声$ git_log_verify 如果$ git_commitId = $ git_log_verify然后 坎德拉/工作区 git_authorName = git log --pretty=format:"%an"; echo $ git_authorName fi脚本来获得最后的混帐

+4

问题在哪里? – Bruno9779

回答

7

这是你在找什么?

git log -1 --pretty=format:'%an' 
+0

O,,*无用*使用'grep'和'head'。 – 0andriy

+1

@ 0andriy不再:) –