Skip to content

Instantly share code, notes, and snippets.

@stasl
Created July 3, 2013 12:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stasl/5917465 to your computer and use it in GitHub Desktop.
Save stasl/5917465 to your computer and use it in GitHub Desktop.
rebase current branch
BRANCH=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
git co master;
git pull --rebase;
git co $BRANCH;
git rebase master;
git push --force origin $BRANCH;
@kont-noor
Copy link

just suggestions

get current branch:
git branch | sed -n '/* /s///p'

rebase:
git fetch origin
git rebase origin/master

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