Skip to content

Instantly share code, notes, and snippets.

@thurloat
Created January 30, 2013 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thurloat/4676387 to your computer and use it in GitHub Desktop.
Save thurloat/4676387 to your computer and use it in GitHub Desktop.
svn stash, like git?
# named svn stashes.
# ex: svn_stash foo -- stashes all changes in a patch named .stash-foo
# ex2: svn_stash pop foo -- patches the foo stash back onto svn.
function svn_stash() {
if [ -z "$1" ]
then
echo "Missing stash name argument"
else
if [ "$1" == "pop" ]
then
local stashname=".stash-$2"
patch -p0 < $stashname; rm $stashname
else
svn diff > .stash-$1; svn revert -R .
fi
fi
}
@pmdarrow
Copy link

You should try git svn again. With an up-to-date svn server it works flawlessly.

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