如何获得Git的最后提交的作者? [英] How to get the author of the last commit in Git?
本文介绍了如何获得Git的最后提交的作者?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Git存储库中获取最新提交的作者?
How to get the author of the latest commit in a Git repository?
#!/bin/bash
git_log=`git ls-remote git url master`
git_commitId = git_log | cut -d " " -f1
echo $git_commitId
cd /workspace
git_log_verify = `git rev-parse HEAD`
echo $git_log_verify
if $git_commitId =$git_log_verify then
cd /workspace
git_authorName=`git log --pretty=format:"%an"`;
echo $git_authorName
fi
推荐答案
这是您要寻找的:
git log -1 --pretty=format:'%an'
这篇关于如何获得Git的最后提交的作者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文