2 ms·
Rebase got a lot less annoying now that git has gained the update-refs ability. I'm often working on multiple branches simultaneously, and update-refs lets me
by bryanlarsen 3y ago
Rebase got a lot less annoying now that git has gained the update-refs ability. I'm often working on multiple branches simultaneously, and update-refs lets me easily work on them as a stack.
- ptx 3y agoHow do you use it? It sounds (from the manual page) like it just changes what a branch points to... so how is it different from "git reset --soft"?
- bryanlarsen 3y agoHere's how i use it: I call my HEAD "bl-dev". Let's suppose I have 5 commits on bl-dev that aren't on main. Each of those commits is a branch with a functional name. If I type "git rebase --update-refs origin/main" all 6 branches get updated, not just bl-dev. Let's suppose the next thing I do is add something to the bottom of my 5 branches. I dont switch to the branch, I stay on bl-dev and add a commit to bl-dev. Then I type "git rebase --update-refs -i HEAD~7" and move the commit up in the stack to the correct location and again all 6 branches update. "git rebase --update-refs -i" also gains the ability to change which commit any branch points to. I don't actually type "--update-refs", it's a gitconfig.