如何使用x.diff.txt修补项目?

时间:2018-01-08 01:10:53

标签: git patch

我在tmux https://github.com/tmux/tmux/issues/1225

上打开了一个问题

维护者告诉我

  尝试像这样的x.diff.txt,然后从-vvvv

显示tmux日志

x.diff.txt是:https://github.com/tmux/tmux/files/1609045/x.diff.txt

它看起来像git diff。我认为这是一种补丁,但如何将此文件应用于整个项目?我只用tortoisegit来解决冲突。

1 个答案:

答案 0 :(得分:0)

https://www.devroom.io/2009/10/26/how-to-create-and-apply-a-patch-with-git/

了解git apply

我的问题

git clone https://github.com/tmux/tmux

cp x.diff.txt tmux & cd tmux

# take a look at what changes are in the patch
git apply --stat x.diff.txt

# test the patch before you actually apply it, no output means fine
git apply --check x.diff.txt

# If you don't own the project 
git apply x.diff.txt 

# If you own the project 
git am x.diff.txt