521
submitted 2 months ago by n3cr0@lemmy.world to c/programmerhumor@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] cyborganism@lemmy.ca 38 points 2 months ago

You need to merge more often.

Rebase. That's where the real trauma is.

[-] zalgotext@sh.itjust.works 24 points 2 months ago

Neither rebasing nor merging should cause trauma if everyone on the team takes a day or two to understand git

[-] cyborganism@lemmy.ca 11 points 2 months ago

I consider myself above average in terms of Git know how. But I've come across situations using rebase where you're stuck resolving the same conflicts over several commits.

I still don't understand that part quite well.

This doesn't happen when you do a normal merge though. Making it easier to manage

[-] sushibowl@feddit.nl 3 points 2 months ago

The reason for this is that git rebase is kind of like executing a separate merge for every commit that is being reapplied. A proper merge on the other hand looks at the tips of the two branches and thus considers all the commits/changes "at once."

You can improve the situation with git rerere

[-] cyborganism@lemmy.ca 2 points 2 months ago

Holy shit! I never took the time to read about it rerere. But it all makes sense now.

However, it's still a lot of extra steps for what could otherwise be really simple with a regular merge.

Is there really a big advantage in using rebase vs merge other than trying to keep a single line of progress in the history? It's it really worth all the hassle? Especially if you're using a squash merge in a pull request...

[-] zalgotext@sh.itjust.works 1 points 2 months ago

I don't think rerere applies here. Once you do a rebase, the rewritten commits should contain the conflict resolutions. The only way conflicts could reoccur on subsequent rebases is if changes reoccur in those same files/lines.

load more comments (12 replies)
load more comments (15 replies)
load more comments (17 replies)
this post was submitted on 28 Aug 2024
521 points (96.9% liked)

Programmer Humor

32361 readers
872 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS