假设我有3个文本文件ours.txt、base.txt和theres.txt,并希望对它们进行三向合并。当我在GitBash中调用git merge-file -p ours.txt base.txt theirs.txt
时,它将打印合并的文本
然而,当我跑步的时候
import subprocess
dir = "path/to/text files"
cmd = ["git", "merge-file", "-p ", "ours.txt", "base.txt", "theirs.txt"]
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, cwd=dir)
我可以通过
(out, error) = p.communicate()
但似乎无法将在Git Bash中打印的合并文本存储在变量中
有人知道如何取回它吗
提前谢谢
目前没有回答
相关问题 更多 >
编程相关推荐