Fix “missing” files in Subversion

When you do a svn status and the output shows files starting with an exclamation mark (“missing”), try to svn revert them if normal methods (svn update/cleanup/etc) don’t work.

Recursively execute command on svn directories

If svn directories get locked or otherwise changed by a user that doesn’t own all the files in a checked out directory, you may need to operate only on the svn directores, and you can use:

find . -type d -name .svn -exec chown -R tomcat:tomcat "{}" \;

subversion merge branch into trunk

http://svnbook.red-bean.com/en/1.6/svn.branchmerge.basicmerging.html

see: http://www.mediawiki.org/wiki/Quick_SVN_merging_guide

older guide:
see: http://www.sepcot.com/blog/2007/04/SVN-Merge-Branch-Trunk

Click here to see example

Check out a copy of trunk: svn co svn+ssh://server/path/to/trunk

Check out a copy of the branch you are going to merge: svn co svn+ssh://server/path/to/branch/myBranch

Change your current working directory to “myBranch” Find the revision “myBranch” began at: svn log –stop-on-copy

This should display back to you the changes that have been made back to the point the branch was cut. Remember that number (should be rXXXX, where XXXX is the revision number).

Change your current working directory to trunk # Perform an SVN update: svn up

This will update your copy of trunk to the most recent version, and tell you the revision you are at. Make note of that number as well (should say “At revision YYYY” where YYYY is the second number you need to remember).

Now we can perform an SVN merge: svn merge -rXXXX:YYYY svn+ssh://server/path/to/branch/myBranch

This will put all updates into your current working directory for trunk. Resolve any conflicts that arose during the merge

Check in the results: svn ci -m “MERGE myProject myBranch [XXXX]:[YYYY] into trunk”

svn error: “…containing working copy admin area is missing”

If you get this error by deleting a directory manually before committing or other corruption, here is one possible fix. (One that is particularly applicable if it’s an empty directory or one otherwise without a lot of stuff. In my case I was trying to add an empty cache directory so it exists in the repo with the goal of ignoring the contents.)

  • move the directory outside of your repo
  • svn --force del directoryname
  • recreate the directory and add back to repo with svn, copy any previous files (should be free of any .svn dirs)
  • Subversion conflict resolution

    I often forget the command for subversion conflict resolution. If you rename or move files, it can sometimes be hard to stop svn from complaining. If you are sure your local copy is correct, you can use this and avoid having to empty and re-download your local copy.

    svn resolve --accept=working FILENAME/FOLDERNAME

    « Previous Entries