Showing posts with label svn. Show all posts
Showing posts with label svn. Show all posts
Monday, February 13, 2017
Find when a branch was created in svn
Find when a branch was created in svn
If you merge between branches and HEAD in subversion, you most likely need to know at what revision the branch was created at. Assuming you dont have the luxury of the new merging features in subversion 1.5, here is a trick I learned from the svn docs.
svn log --stop-on-copy http://server/svn/myapp/branches/myapp-1.0
This will stop once it hits the revision the branch was created at, verses continuing on until r1. Previously I would log the entire branch, and do a grep for the comments I inserted when I created the branch. Not ideal but it worked. Now I use the --stop-on-copy option and I know real quick the revision the branch was created at. Giving me the revision I need to use in the merge.
svn merge -r 546:767 http://server/svn/myapp/trunk
Cant wait until we upgrade to subversion 1.5 or a DVCS.
Available link for download
Saturday, February 11, 2017
Favorite svn commands
Favorite svn commands
Recently I switched from Windows to Linux, or more specifically Ubuntu 7.0.4. With a couple of minor issues, everything is working great so far. One of the main reasons for changing was to be faster and better at what I do, and I think linux can help me achieve some that.
One common thing I feel makes linux developers faster is knowing commands and not requiring GUIs. GUIs take a long time to load and refresh compared to just opening a file in vi or vim. On windows I loved SmartSVN and would recommend it to anyone; in fact I have had to install it on linux until I have been converted. At the same time I have enjoyed learning the svn commands, which by the way are 100 times easier than cvs commands. Most cvs commands require options to be effective (cvs update -Pd). Not so with svn.
Here is a list of favorite svn commands I have come to love. Also included are recommendations from friends.
- svn help
. For example svn help update - svn status. List modified or uncommitted files
- svn update. Get the latest code and update your modified files
- svn commit filename -m "Commit Message". Commit the file. filename is optional
- svn diff. Do a diff on locally modified files.
- svn diff -r M:N. Performs a diff on the revisions M and N
- svn merge -r M:N. Revert back to a previous version
- svn log -v. Gives you a verbose log of everything that has happened
- svn st | grep "?" | awk {print $2} | xargs svn add. Handy command for those who go days without committing and need an easy way to commit uncommitted files.
- svn propedit svn:ignore. Tells subversion to ignore certain files or directories.
- svn revert filename. Takes the filename out of source control. Handy when commnd #9 adds files you didnt intend to add.
Finally, dont be disappointed if you are a windows developer. You can use svn in cygwin the same way.
Available link for download
Subscribe to:
Posts (Atom)