2017-04-13 85 views
7

我正在嘗試在2次提交之間獲取更改的作者。如何獲取2次提交之間的更改作者?

什麼是最適合我的是一樣的東西:但

git diff --name-only master 

代替

--name-only 

參數一樣

--authors-only 

但不幸的是diff沒有這樣的一個。有沒有限制,我必須使用diff命令,git log或其他人也很好。

我需要它來責怪那些導致測試失敗的人。

回答

4

git log --pretty=format:"%an" prevTestCommit..lastTestCommit | sort | uniq

0

不知道這每默認存在,但你可以爲git log指定自定義輸出格式:

git log --pretty="format:%an" 

這將只打印作者姓名。有關詳細信息,請參見PRETTY FORMATSgit log --help

3

,你可以使用類似

git log --pretty=format:"%an %aE" f398e997ea9ad81e586b1f751693cd336963ba6a ^bb69eb11d979437a0b390ac9333342e7594c211c 

了格式將打印的作者姓名和電子郵件,比提交 看到List commits between 2 commit hashes in git

瞭解更多信息關於如何使用獲取兩個給定提交之間的提交。

+0

出於某種原因跡象「^」 betweend哈希不爲我工作,我需要把「..」像@DAle回答說。 –

相關問題