我需要记录我的老师的所有我的git提交。他给了我下面的例子:对于每个提交散列使用git显示
git log --pretty="%H" --author=you | while read commit_hash
do git show $commit_hash
done > log.txt
我知道“你”部分需要我的名字和Git的命令工作正常,但管后,用大于号返回,并没有做任何事情。我也明白它应该使用git show
命令的每个提交散列。有什么建议么?我也在使用OSX。
难道不应该由一个行中键入它只是工作? –
@AdrianZ。为此,您需要';',例如:'while read commit_hash;做git show $ commit_hash; done> log.tx'(http://www.cyberciti.biz/faq/linux-unix-bash-for-loop-one-line-command/) – VonC
谢谢。这工作完美。重新学习新的东西。 –