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 didn't intend to add.
Finally, don't be disappointed if you are a windows developer. You can use svn in cygwin the same way.
2 comments:
This is a great tutorial on common real world SVN scenarios and what commands to apply to them.
http://www.duchnik.com/tutorials/vc/svn-command-reference
Post a Comment