2014-01-25 29 views

回答

1

--stdout選項git format-patch

完整的Python表達式應該是這樣的:var = subprocess.check_output(["git", "format-patch", "--stdout", <tree-ish arguments...>])

此外,如果你需要大量的混帳回購操作,你可以考慮使用GitPython

+0

有並排的方式在補丁文件中生成差異代理? –

+1

好吧,'git diff'允許運行外部diff,包括並排diff。請參閱http://stackoverflow.com/questions/7669963/how-can-i-get-a-side-by-side-diff-when-i-do-git-diff然而,可能'git format-patch' doesn' t支持這一點。如果你設法通過「stock」'git diff'獲得並排diff,那麼你可以嘗試在'git format-patch'中使用這些標誌。 – user3159253

相關問題