Basic Commands:

  • svn checkout [URL]: Check out a working copy from a repository.
  • svn add [file/folder]: Schedule files or folders to be added to the repository.
  • svn commit -m “[message]”: Commit changes to the repository with a commit message.
  • svn update: Update your working copy to the latest revision.
  • svn status: Show the status of files and directories in your working copy.
  • svn diff [file]: Display the differences between your working copy and the latest revision.

Repository Operations:

  • svn import [path] [URL]: Import unversioned files or directories into a repository.
  • svn export [URL] [path]: Export a clean directory tree from the repository.
  • svn mkdir [URL]: Create a new directory in the repository.

Branching and Merging:

  • svn copy [URL1] [URL2]: Copy files or directories within the repository (used for branching).
  • svn merge [URL]: Merge changes from one branch to another.
  • svn switch [URL]: Switch your working copy to a different branch or tag.

Tagging:

  • svn copy [URL]@[revision] [URL/tags/tagname]: Create a tag for a specific revision.
  • svn switch [URL/tags/tagname]: Switch your working copy to a specific tag.

Undo Changes:

  • svn revert [file]: Revert changes made to a file.
  • svn delete [file/folder]: Schedule items for removal from version control.
  • svn copy -r [revision] [URL] [path]: Copy a file or directory from a specific revision.

Informational Commands:

  • svn info [URL]: Display information about the repository or working copy.
  • svn log [URL]: Show the log messages for a set of revision(s).
  • svn help [command]: Display help for a specific command.

Ignoring Files:

  • Edit svn:ignore property: Ignore specific files or patterns in your working copy.

Global Configuration:

  • svn propset svn:global-ignores [patterns]: Set global ignore patterns.

Remember to replace placeholders like [URL], [file], or [path] with your specific repository URL, file name, or path. SVN is a powerful tool for version control, and mastering these commands will enhance your ability to manage source code effectively.