Skip to content

Instantly share code, notes, and snippets.

@jpsirois
Created November 8, 2012 14:59
Show Gist options
  • Save jpsirois/4039304 to your computer and use it in GitHub Desktop.
Save jpsirois/4039304 to your computer and use it in GitHub Desktop.
SVN ZSH Alias for CLI Awesomeness (for Git users)
# Alias SVN {{{
alias s="svn"
alias sl="svn log"
alias ss="svn status"
alias sc="svn commit"
alias su="svn update"
alias sd="svn diff"
alias saa="svn status | grep '^?' | sed 's/^? *\(.*\)/\"\1\"/g' | xargs svn add"
alias sra="svn status | grep '^!' | sed 's/^! *\(.*\)/\"\1\"/g' | xargs svn rm"
alias scl="svn changelist"
alias sclr="svn changelist --remove"
alias sstash="svn diff > _svn-diff.txt | svn revert -R ."
alias sstashpop="patch -p0 -i _svn-diff.txt && rm -rf _svn-diff.txt"
# Git SVN
# Thank to http://viget.com/extend/effectively-using-git-with-subversion
alias sclone="git svn clone"
alias spull="git svn rebase"
alias spush="git svn dcommit"
# }}}
@jpsirois
Copy link
Author

jpsirois commented Nov 8, 2012

I’m sorry, I know… SVN stuff on GitHub ;)

@EtienneLem
Copy link

@gcauchon
Copy link

gcauchon commented Nov 8, 2012

I tried to get the SCM guy to actually just think about Git; I event put an octocat sticker on hie coffee mug! No success yet... I said YET!

@jpsirois
Copy link
Author

jpsirois commented Nov 8, 2012

@EtienneLem I’ll look into that, but from what I’ve read it’s not always safe for some kind of stuff. Like branching with "git svn".

@remi
Copy link

remi commented Nov 8, 2012

I’ve worked with a few SVN repositories in the last months — when using git-svn is practically doesn’t make any difference with to local workflow!

This tutorial is a must-read if you want to get into it.

@jpsirois
Copy link
Author

Nice thank!

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