Skip to content

Instantly share code, notes, and snippets.

@jpdelatorre
Created June 8, 2011 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpdelatorre/1014726 to your computer and use it in GitHub Desktop.
Save jpdelatorre/1014726 to your computer and use it in GitHub Desktop.
Basic SVN commands
#initial import to repository
$ cd project_dir
$ mkdir branches tags trunk
$ svn import . http://repository/
#checkout a working copy
$ cd project_dir
$ svn co http://repository/trunk . --username your_username
#creating a new branch
$ svn copy http://repository/trunk http://repository/branches/new_branch_name
#merging trunk changes to a branch
$ cd branch_working_copy
$ svn merge http://repository/trunk
$ svn commit -m "merged latest trunk changes to my branch"
#merging branch back to trunk
$ cd trunk_working_copy
$ svn up
$ svn merge --reintegrate http://repository/branches/branch_name
....do some test and make sure everything is working....
$ svn commit -m "merge branch_name back into trunk"
$ svn delete http://repository/branches/branch_name -m "remove branch_name"
#rollback to previous revision
$ cd trunk_working_copy
$ svn up
$ svn merge --dry-run -r:15:11 http://repository/trunk
... check if changes are fine ...
$ svn merge -r:15:11 http://repository/trunk
$ svn commit -m "reverted to revision 11"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment