Difference between revisions of "SVN"
From Vague Hope Wiki
Line 41: | Line 41: | ||
find . -type f -not -path "*/.svn/*" -print0 | xargs -0 md5sum > md5sums.txt | find . -type f -not -path "*/.svn/*" -print0 | xargs -0 md5sum > md5sums.txt | ||
+ | // Branch with changes. Ensure all new files are under version control (svn add). | ||
+ | svn copy . http://example.com/branches/newbranch | ||
+ | svn switch http://example.com/branches/newbranch | ||
+ | svn st | ||
</pre> | </pre> |
Latest revision as of 02:49, 18 January 2012
// Just revision number. svn info https://example.com/foo/trunk 2>/dev/null | sed -ne 's#^Revision: ##p' // Totally revert a directory and sub directories. svn revert -R . svn status --no-ignore | grep '^\?' | sed 's/^\? //' svn status --no-ignore | grep '^\?' | sed 's/^\? //' | xargs rm -rf // List modified files. svn status | grep '^M' | sed 's/^M //' // List unversioned files. svn status | grep '^\?' | sed 's/^\? //' // List unversioned .java files. svn status | grep '^\?' | sed 's/^\? //' | grep ".java" // Remote diff. svn diff --summarize -r 9028:9029 http://example.com/foo // Fetch a single file at a specific revision. svn export -r 9029 http://example.com/foo/trunk/bar/file.txt@9029 // List info about a file, including size. svn ls -v -r 9029 http://example.com/foo/trunk/bar/file.txt@9029 // Export all changed files between two revisions: for i in $(svn diff --summarize -r 8278:9439 http://example.com/foo/trunk/ | awk '{ print $2 }'); do p=$(echo $i | sed -e 's{http://example.com/foo/trunk/{{'); mkdir -p $(dirname $p); svn export --depth empty $i $p; done // Dump a revision to a remote box over ssh. svnadmin dump --incremental -r 9029 /var/www/svn/foo | ssh user@example.com 'cd /tmp ; cat > r9029' // Find when a branch was made? svn log --verbose --stop-on-copy https://example.com/branches/foo/ // SVN merge list of files (files.txt) from trunk to working copy (of a branch). cat files.txt | xargs svn merge http://example.com/foo/trunk // MD5 src tree. find . -type f -not -path "*/.svn/*" -print0 | xargs -0 md5sum > md5sums.txt // Branch with changes. Ensure all new files are under version control (svn add). svn copy . http://example.com/branches/newbranch svn switch http://example.com/branches/newbranch svn st