News for hackers. Stuff that matters.
Re:Git Tricks: Avoiding merge when dealing with remote confl... by sam36 on Monday October 21, 2019 @07:53PM (#21318898)
Any good git "best practices" doc will inform the user to never use rebase on a shared remote repo. The details are given, but sadly I can never really follow the logic. Rebase always sounds like a good idea (imo). And being the only one to use rebase on my team... I've had several instances where I go to rebase a remote branch onto my local work, and I'm met with tons of conflicts.. except the conflicts are all my own commits from a later time. I've never really figured out why, but I've since just stopped using rebase unless I really know there is nothing funny on the remote branch.
Re:Git Tricks: Avoiding merge when dealing with remote confl... by danzanzini on Monday October 21, 2019 @08:18PM (#21319054)
The conflicts from a later time happens because rebase applies one commit at a time.

If you solve a conflict from your first commit by applying changes that were made only in the later ones, you'll need to solve this same conflict again and again.

Re:Git Tricks: Avoiding merge when dealing with remote confl... by sixstringtheory on Monday October 21, 2019 @08:27PM (#21319122)
If resolving the same conflicts over and over again in many commits gets onerous enough to make it worthwhile investing a little time learning another part of git, you can check out git-rerere (Reuse recorded resolution): https://git-scm.com/docs/git-rerere
Re:Git Tricks: Avoiding merge when dealing with remote confl... by sam36 on Monday October 21, 2019 @09:27PM (#21319482)
What the heck
Re:Git Tricks: Avoiding merge when dealing with remote confl... by mcv on Tuesday October 22, 2019 @10:06AM (#21323715)
Rebase should not be done on a large history. Merge long histories, only rebase short ones. Long histories are probably useful to see separately in the git history anyway, and it's only for a history of one or two commits that the extra merge commits begin to dominate the real commits in your history.

When in doubt, just merge. It's always safer.