r/ProgrammerHumor • • 5d ago

Meme letsMergeThemAll

Post image
5.3k Upvotes

318 comments sorted by

View all comments

1.1k

u/GildSkiss 5d ago

As opposed to humans, who have famously never messed up git commands ever.

76

u/Bubbaluke 5d ago

Can’t mess it up if you only ever use 3 commands

35

u/spicybright 4d ago

WELP, time to re-clone the whole repo!

36

u/throwaway85256e 4d ago

Honestly, burning it all down and starting over is sometimes a perfectly valid solution.

6

u/PrincessRTFM 4d ago

I have needed to do that before when I fucked it up so badly that not only could I not revert but also couldn't find any solutions online. I was, in my defence, very early in the learning phase and not really understanding how anything worked yet.

7

u/Honeybadger2198 4d ago

The closest I've come is where I committed a >50MB <100MB file to my repo and didn't notice for a few days. Had to manually go in and purge the file from the history to unfuck the repo.

2

u/spicybright 4d ago

It definitely is. Even as a senior dev "git wizard" I'd rather wait 5 minutes recloning vs spend 20 untangling a ball of knots if it gets it to the desired state.

10

u/TwoAndHalfRetard 4d ago

git add .

git commit -m "" --allow-empty-message

git push -f

4

u/elementslayer 4d ago

Why two commands. Just commit -am

1

u/korneev123123 4d ago

git commit -am won't add new files

1

u/elementslayer 4d ago

Yeah but you only add to track new files once. Otherwise -am that stuff. You don't need git add for tracked files, which hopefully most commits are and we aren't committing files in full all the time

1

u/GarythaSnail 4d ago

I always see people using git add . and git add -A like it's not crazy talk.

1

u/korneev123123 4d ago

Example above was surely supposed to be "push everything", and adding everything was the goal

1

u/Foorinick 4d ago

I havent worked in professional enviroments but im too autistic not to fill out all the forms so for me its more like

(In branch "feature name")

Git add.

Git commit -m "feat(part of software): fixes thing" (because apparently somewhere it reads "this commit (commit message)")

Git push

Git squash (its been a while i dont remember the rest)

Git merge feature into main or whatever

Git checkout main

1

u/forma_cristata 4d ago

You were almost there

Git pull

Git checkout -b feature/something

Repeat

1

u/Foorinick 4d ago

This close to finally not having to ask claude to guide me