Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How 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"?


Here'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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: