首页 > 代码库 > git diff 打补丁

git diff 打补丁

[root@workstation2017 demo]# git diff old new >cc.diff
[root@workstation2017 demo]# cat cc.diff
diff --git a/old/a/p/foo.txt b/new/a/p/foo.txt
index f041bcd..7351245 100644
--- a/old/a/p/foo.txt
+++ b/new/a/p/foo.txt
@@ -1,2 +1,2 @@
-old_line_1
-old_line_2
+new_line_1
+new_line_2

git diff 打补丁