Skip to content

Instantly share code, notes, and snippets.

@osamaqarem
Last active March 31, 2020 04:11
Show Gist options
  • Save osamaqarem/48dff17276a5e64f9da42b03328382f6 to your computer and use it in GitHub Desktop.
Save osamaqarem/48dff17276a5e64f9da42b03328382f6 to your computer and use it in GitHub Desktop.
SVN for Git Users

Add all files

svn add --force * --auto-props --parents --depth infinity -q

Remove all files

svn revert * --depth infinity -q

Edit svn:global-ignore for current directory

(Easiest. Ignores must be set on parent directory)

svn propedit svn:global-ignores .

Ignore files

svn propset svn:global-ignores "filename" .

Show ignored files for current directory

svn proplist -v

Show all ignored files

svn status --no-ignore | grep "^I"

Unadd a file

svn revert filename

Excalamation Mark (!)

Restore:

svn revert /path/to/file

Delete:

svn rm /path/to/file

Delete All:

svn status | grep '^\!' | sed 's/! *//' | xargs -I% svn rm %

Golden rule is: once something is under svn-control, any moving, deleting, renaming, should be done with svn commands (svn mv, svn rm, etc.), not using normal filesystem/file-explorer functions.

Checkout Specific Reversion

e.g. to revision 3761

svn up -r3761

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment