this post was submitted on 08 Nov 2023
69 points (84.2% liked)

Programming

16971 readers
172 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
69
Why Git is hard (roadrunnertwice.dreamwidth.org)
submitted 10 months ago by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 8 points 10 months ago (1 children)

That being said, I still don’t mess around with rebase for anything

Rebasing has a worse reputation than it deserves. It's something you just get used to - just like how git use is, when you started using it. There are a couple of strategies to make it easier and less anxiety inducing:

  1. Before starting a rebase of a long branch, create a new branch. That way in case you seriously mess up, you can just delete the rebasing branch and rename the old branch to restore everything (you can usually get away with rebase abort. This is just added safety). Even in case of a successful rebasing, you can just keep the backup branch around, as a faithful record of actual development history.
  2. Do only one (or max 2) operations in a single rebases. Do this over multiple rebases to get what you want.

After a while, rebasing becomes as simple as commit or merging.

[–] [email protected] 2 points 10 months ago

Rebasing and merge conflicts are the top ways that git can turn into a mess. I know that rebasing could (in some circumstances) make merge conflicts less of an issue, but I just mostly think the value of "commit grooming" is overrated. I don't want to argue about this, if you like doing it, go ahead.