r/ProgrammerHumor • • Oct 15 '26

Meme letsMergeThemAll

Post image
5.4k Upvotes

316 comments sorted by

View all comments

21

u/Ok_State5255 Oct 15 '26

I used to be the release lead for a major company. We had 16 developers split over 4 teams going into on production org.

The amount of ignorance surrounding Git was always astounding to me. I'm a pretty stupid guy (I once pulled a cast iron skillet out of the oven without remembering to grab a potholder. That was...painful), but you really only need to remember like 8 commands to do 99% of the work.

Nope, instead we have shit tools like Copado and Autorabit because people believe it's easier to point-and-click your way through. And I would have to clean up the inevitable messes.

Watch a 30 minute youtube video. Fuck up a commit...okay! You can revert it. Fuck up your branch? Start a new one and recommit!

It's designed to be easy. Somehow we all lost sight of that .

9

u/Groentekroket Oct 15 '26

What is wrong with a GUI for Git? I always use the IntelliJ Git interface and 1 only need to use the CLI like once a year. Everybody squashed their branches and rebases on main. We make sure we don’t pick up stories that interfere with each ofher and we never face any problem. 

4

u/visualdescript Oct 15 '26

If you're squash merging, what's the point of rebasing on main, just merge main in whenever you need to?

6

u/Dancing7-Cube Oct 15 '26

this drives me nuts lol, sometimes I'll get a stickler that refuses to approve until I clean up my commits, even though it squashes

like who cares, unless the PR is 10k lines, read the diff, the commits are basically just checkpoints in case my laptop SSD randomly dies

1

u/LegendaryMauricius Oct 15 '26

git conflicts can be painful when they're with main, with several other feature branches already being merged there.

3

u/visualdescript Oct 16 '26

How does rebasing make the conflicts any easier, you're still going to have to resolve them

1

u/LegendaryMauricius Oct 16 '26

Because you can resolve them one by one, by changing only the branch you want to merge. It does feel wrong though. If there's another way, please tell me lol.

2

u/awesome-alpaca-ace Oct 17 '26

I have not tried it in the case where many feature branches are merged into main, but I have had way more success with a hard reset to shared commit, merge, and then cherry picking my commits that got yeeted into the void during the hard reset. I get no conflicts, it is fantastic. A normal merge or rebase will always give me conflicts, but the hard rest does wonders.

3

u/Foorinick Oct 15 '26

I mean, I've been trying to learn how to git properly but thw only place i found digestible information was unironically by asking ai on how to do it properly, but even then there are so many different things you have to understand and git barely explains or links anything to explain how one might unfuck themselves

1

u/awesome-alpaca-ace Oct 17 '26

Once you understand commits, their hashes, resets, merges, cherry picks, pushes, pulls, diffs, and branches you are pretty much there. Of course you can do so much more too.

2

u/dylanzt Oct 16 '26

When I was in industry, I was never a great engineer. But I spent half a day learning the internals of git and it was probably the most valuable thing I ever did for my career. It's genuinely shocking how poorly people understand it, considering how much they have to interact with it.

1

u/awesome-alpaca-ace Oct 17 '26

Yea, once you learn it, it is incredibly nice to work with

1

u/LegendaryMauricius Oct 15 '26

git command is definitely designed stupidly though. The system should be easy, but it's also easy to end up in a git specifics rabbithole because something got fucked up either by a bad command or some remote communication bug.

1

u/awesome-alpaca-ace Oct 17 '26

Most commits stay in git even when you do a hard reset. I forget how to get them since I usually note the commits before a reset, but you can find them and reapply them.  I think it is quite hard to lose a commit, but I'm not real sure...

1

u/LegendaryMauricius Oct 17 '26

True, but anything more complex than hard reset will have you searching through very unfriendly interfaces and modifying your git commands back and forth just to get the info on what happened. Even hard reset makes me check whether the selected commit is included or not every time...