SVN Commands Reference
This page provides a quick reference for essential Subversion (SVN) commands, a widely used version control system. Mastering these commands is crucial for efficient source code management and collaboration.
Update Working Copy
To synchronize your local working copy with the latest changes from the repository, use the svn update
command. This command fetches new revisions and merges them into your local files.
svn update "/path/to/your/working/copy"
Check Working Copy Status
The svn status
command displays the status of files and directories in your working copy. It helps you identify modified, added, deleted, or unversioned files.
svn status
View Local File Changes
To see the specific differences between your local file and the version in the repository, use the svn diff
command. This is invaluable for reviewing your changes before committing.
svn diff "/path/to/your/file.txt"
Add New Files or Folders
When you create new files or directories that you want to track with SVN, use the svn add
command to stage them for inclusion in the repository.
svn add "path/to/new/item"
Revert Local Changes
If you need to discard uncommitted local modifications and restore a file to its last committed state, the svn revert
command is your tool.
svn revert "/path/to/your/file.txt"
Commit Changes to Repository
Once you are satisfied with your local changes, use the svn commit
command to send them to the central repository. Always include a descriptive commit message.
svn commit -m "Your descriptive commit message" "/path/to/your/changes"
Get Help for SVN Commands
For detailed information on any SVN command, including its options and usage, you can use the svn help
command followed by the command name.
svn help diff