Skip to content

Instantly share code, notes, and snippets.

@nickyleach
Created March 9, 2011 20:12
Show Gist options
  • Save nickyleach/862899 to your computer and use it in GitHub Desktop.
Save nickyleach/862899 to your computer and use it in GitHub Desktop.
git alias to sync the current branch
[alias]
sync = "!f(){ local branch=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e \"s/* \\(.*\\)/\\1/\"`; git pull origin $branch && git push origin $branch; }; f"
@kjohnsen
Copy link

kjohnsen commented Jun 4, 2018

Super useful. Thanks!

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