Linux svn 生成/打patch
checkout:
svn checkout svnPath; //checkout后目录里面有.svn隐藏文件
?
修改系统默认语言:
ubuntu默认的LANG环境变量是zh_CN.UTF-8,这对以后打patch时可能有影响,最好把LANG该为英文:
在/etc/profile加上export LANG=us_EN.UTF-8,此后运行svn会有warn:
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LANG is us_EN.UTF-8
svn: warning: please check that your locale name is correct
解决:
在/etc/profile加上export?LC_ALL=C
最后source /etc/profile 使设置生效
设置后系统就是英文的了。
?
生成patch文件:
svn diff > patchFile ;//整个工程的变动生成patch
或svn diff file >patchFile ;//某个文件单独变动的patch
?
svn回滚:
svn revert FILE; //单个文件回滚
svn revert DIR --depth=infinity; //整个目录进行递归回滚
?
打patch:
patch -p0 < test.patch; //-p0 选项要从当前目录查找目的文件(夹)
?
?