3 ms·
I had to make an alias for rebasing, because I kept doing the opposite: git checkout master #check out the branch to apply commits to git rebase mybran
by orthoxerox 7mo ago
I had to make an alias for rebasing, because I kept doing the opposite:
git checkout master #check out the branch to apply commits to
git rebase mybranch #Apply all commits from mybranch
Now I just write
rebase-current-branch
and it does what I want: fetches origin/master and rebases my working branch on top of it.
But "ours"/"theirs" still keeps tripping me up.
- cerved 7mo agoTip, you may want to use origin/HEAD over origin/master
- orthoxerox 7mo agoIs it the naming-independent identifier of the tip of the trunk?
- cerved 7mo agonot strictly speaking, but in practice it's the tip of the remote default branch
- skydhash 7mo agoYou can use the --onto flag for git rebase git rebase --onto origin/master It will checkout origin/master and replay the current branch on top. P.S. I had to check the man page as I use Magit. In the latter I tap r, then u. In magit my upstream is usually the main trunk. You can also tap e instead of u to choose the base branch.