Re:Linus’s rules on keeping Git history clean (2009)
by hanniabu on Wednesday September 04, 2019 @02:39AM
(#20874568)
If you're working with a group of people you should never git pull prior to a commit and always git push -f
[ Parent
| on HN ]
Re:Linus’s rules on keeping Git history clean (2009)
by juliusmusseau on Wednesday September 04, 2019 @02:45AM
(#20874595)
Joking aside, "git pull -r" is pure magic in the face of upstream rewrites. It always does the right thing:
https://mergebase.com/doing-git-wrong/2018/03/07/fun-with-gi...
After I wrote that blog post someone told me the reason for the magic is the use of "git merge-base --fork-point" under the hood.
Re:Linus’s rules on keeping Git history clean (2009)
by yebyen on Wednesday September 04, 2019 @07:05AM
(#20875944)
`pull --rebase` is nothing, go back and read the history of `rebase --preserve-merges` and now `rebase --rebase-merges`
I have worked with both, and the new one is much better. Of course this only matters if the branch you are rebasing has merges in it (so in all likelihood, you must be a release manager to need features like this)
Between rebase-merges and --onto, I don't spend hardly any time fixing up bad merges anymore.
Re:Linus’s rules on keeping Git history clean (2009)
by human20190310 on Wednesday September 04, 2019 @11:50AM
(#20878364)
I never type
-f or --force
on the same line as git. If someone feels it needs to be done, I try to stop them; failing that, I make sure they're the ones doing it. I don't need that kind of risk.