Skip to content

Instantly share code, notes, and snippets.

@boourns
Created September 21, 2016 15:30
Show Gist options
  • Save boourns/11c64e2161f6acda707ba224c8eb4e32 to your computer and use it in GitHub Desktop.
Save boourns/11c64e2161f6acda707ba224c8eb4e32 to your computer and use it in GitHub Desktop.
Rebase your branch with this 1 simple trick
# add to your .bash_profile
function rebase(){
curbranch=`git rev-parse --abbrev-ref HEAD`
git checkout master
git pull origin master
git checkout $curbranch
git rebase master
}
@boourns
Copy link
Author

boourns commented Sep 21, 2016

related command, open github for current git repo:

function github(){
  open `git remote show origin | grep "Fetch URL" | sed 's/.*git@/https:\/\/www./' | sed 's/github.com:/github.com\//' | sed 's/\.git$//'`
}

@insom
Copy link

insom commented Sep 21, 2016

Also: git fetch origin && git rebase origin/master while staying on your branch.

Many ways to shave a yak...

@jules2689
Copy link

@boourns with dev you can also type dev open gh to open github. dev open pr to open a PR for a branch (or prompt to create one on GH), or dev open issues to open that project's issues list.

Will be much more useful for everyone when we open source dev of course :) In the meantime, it is useable on all projects (even without dev.yml's) if you have dev installed.

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