🖥️svn

➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the svn command with important options and switches using examples.

▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁

#                ███████╗██╗   ██╗███╗   ██╗
#                ██╔════╝██║   ██║████╗  ██║
#                ███████╗██║   ██║██╔██╗ ██║
#                ╚════██║╚██╗ ██╔╝██║╚██╗██║
#                ███████║ ╚████╔╝ ██║ ╚████║
#                ╚══════╝  ╚═══╝  ╚═╝  ╚═══╝
                

                                           
# update working copy from repository
svn update "/path"

# show changed files in working copy
svn status

# show what changed in local file
svn diff "/path/filename"

# add files or folders
svn add "path/item"

# revert local uncommited changes
svn revert "/path/file"

# commit changes to repo
svn commit -m "message" "/path"

# show help for 'svn diff'
svn help diff

# Delete unversioned files in a Subversion checkout directory and all subdirectories
svn st | grep ^? | sed -e 's/^? *//' | xargs -i{} echo rm -fr "{}"
# Explanation: If there are no spaces in the file names, a simpler command will be enough. This one-liner works even if there are spaces and certain special characters in the file names.
    # svn st shows the changes in the Subversion checkout
    # | grep ^? matches only lines starting with question mark (= unversioned files)
    # | sed -e 's/^? *//' removes the question mark at the beginning of the line and the space characters following it
    # | xargs -i{} echo rm -fr "{}" executes an echo command for each line in the input, where the command is formed by inserting the input line in the {} placeholder. Confirm the result looks good and remove the echo to perform the rm.
# Limitations: The command will not work with files that have " (double quote) in the name...

# Add all unknown files in a Subversion checkout
svn add . --force
# Explanation: Adding all unknown files in a working tree is usually very simple in other version control systems, for example:
	git add .
	bzr add
# Not so simple in Subversion:
	svn add .
	svn: warning: '.' is already under version control
# But if you add the --force flag, that will do! Keep in mind that this is not the same as:
	svn add * --force
# That would add not only unknown files, but ignored files too, which is probably not your intention. Make sure to specify directories explicitly, avoid using * with this command.

# List the content of a GitHub repository without cloning it
svn ls https://github.com/user/repo/trunk/some/path
# Explanation: Git does not allow querying sub-directories of a repository. But GitHub repositories are also exposed as Subversion repositories, and Subversion allows arbitrary path queries using the ls command.
# Notice the /trunk/ between the base URL of the repository and the path to query. This is due to the way GitHub provides Subversion using a standard Subversion repository layout, with trunk, branches and tags sub-directories.

#==============================##==============================#
# CMD SVN						       #
#==============================##==============================#
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

  █║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌

              ██╗ ██╗ ██████╗  ██████╗ ██╗  ██╗███████╗██████╗
             ████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
             ╚██╔═██╔╝██║  ██║██║   ██║ ╚███╔╝ █████╗  ██║  ██║
             ████████╗██║  ██║██║   ██║ ██╔██╗ ██╔══╝  ██║  ██║
             ╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
              ╚═╝ ╚═╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝╚══════╝╚═════╝

               █║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░