[1] https://svn.apache.org/repos/asf/subversion/trunk/doc/user/svn-best-practices.html
create and apply patch
# create
svn diff > xxx.patch
# apply
svn patch xxx.patch
tortoisesvn右键菜单, 详见:https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-patch.html
注意:
- 在同一个目录create/apply.
- 不要直接rm, mv, cp, 要使用svn rm, svn mv, svn cp
- 移动,删除空文件, svn diff中不会体现, 所以patch文件中没有相应记录
- 添加空文件,svn diff有体现, 不过svn patch命令不会新建文件
- 移动/复制文件(svn mv/cp), 新文件不会体现在diff中[https://groups.google.com/g/reviewboard/c/dJu-5gPnC3s].
示例:
$ svn diff > 003.patch
$ svn st
? 003.patch
A 100
A c.c
M rand.sh
D sh2.sh
$ cd ../workingcopy2
$ svn patch ../workingcopy1/003.patch
A c.c
U rand.sh
D sh2.sh
$ svn st
A c.c
M rand.sh
D sh2.sh
在git中打patch
patch -p0 < xxx.patch
# 或
svn diff --git > xxx.patch
git apply xxx.patch
标签:svn,Cookbook.13,xxx,patch,Subversion,sh,apply,diff
From: https://www.cnblogs.com/faxx/p/17486129.html