Frequently svn commands
How to properly add new files to svn repository?
Creating and applying patch
- svn up
- svn add/delete
- svn update -r 1234 (this is to Revert Local Copy to certain revision instead of head revision)
- svn revert --recursive . (this is revert all local changes)
- svn diff* svn cleanup
- svn status | grep ^\? | cut -c9- | xargs -d \\n rm -r (this will remove all unversioned files and folders from local copy)
How to properly add new files to svn repository?
- never never copy-n-paste a existing folder in your svn checkout; by doing so, you are copying the svn meta data together with source code, and potentially screw up your local copy completely.
- the right way is to create a new folder manually and then copy source files into it.
- next, use 'svn add' to schedule them for checking in.
- until then, 'svn diff' will correctly reflect all your local changes including file addition and deletion.
Creating and applying patch
- svn diff >mypatch.diff
- patch -p0 -i mypatch.diff
This post first appeared on Always Remember, You Are At Most Yourself; And, Yo, please read the originial post: here