Linux svn generate patch & apply patch

Linux svn generate patch & apply patch

checkout:

svn checkout svnPath; //There are .svn hidden files in the directory after checkout

 

Modify the system default language:

The default LANG environment variable of ubuntu is zh_CN.UTF-8, which may have an impact on patching in the future. It is best to set the LANG to English:

Add export LANG=us_EN.UTF-8 to /etc/profile , and then run svn will 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

solve:

Add export LC_ALL = C to /etc/profile

Finally source /etc/profile to make the settings take effect

After setting, the system is in English.

 

Generate patch file:

svn diff > patchFile ;//The changes of the entire project generate patch

Or svn diff file >patchFile ;//A patch of a file that is changed alone

 

svn rollback:

svn revert FILE; // single file rollback

svn revert DIR --depth=infinity ; //The entire directory is recursively rolled back

 

hit patch:

patch -p0 < test.patch; //-p0 option to find the destination file (folder) from the current directory

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326987358&siteId=291194637