Apache Subversion (often abbreviated SVN, after the command name svn) is a software versioning and revision control system distributed under an open source license.
SVN Command
svn help
provides a summary of the available commands
svn checkout/co
This command is used to pull an SVN tree from the server. You should only need to do this once.
svn add
When you are creating a new file or directory, you need to tell the SVN server about it. This command does that. Note that the file won't appear in the repository until you do an svn commit
svn delete/rm
This does what it says! When you do an svn commit the file will be deleted from your local sand box immediately as well as from the repository after committing.
svn status/st
This command prints the status of working directories and files. If you have made local changes, it'll show your locally modified items. If you use the --verbose
switch, it will show revision information on every item. With the --show-updates
(-u
) switch, it will show any server out-of-date information.
You should always do a manual svn status --show-updates before trying to commit changes in order to check that everything is OK and ready to go.
svn update/up
This command syncs your local sand box with the server. If you have made local changes, it will try and merge any changes on the server with your changes on your machine.
svn commit/ci
This command recursively sends your changes to the SVN server. It will commit changed files, added files, and deleted files.
Note that you can commit a change to an individual file or changes to files in a specific directory path by adding the name of the file/directory to the end of the command
svn commit [file path]
The -m
option should always be used to pass a log message to the command. Please don't use empty log messages
svn commit –m “here is a message text”
svn diff
This is useful for two different purposes.
svn move/mv
This command moves a file from one directory to another or renames a file. The file will be moved on your local sand box immediately as well as on the repository after committing.
svn mv SRC DEST
Snippet
How to change the SVN editor
Add SVN_EDITOR variable in ~/.bashrc
vim ~/.bashrc
export SVN_EDITOR=vim
沒有留言:
張貼留言