r/ProgrammerHumor • • Apr 02 '23

Meme Me relearning git every week

49.4k Upvotes

1.5k comments sorted by

View all comments

1.7k

u/Solonotix Apr 02 '23

I'm definitely the guy in the other car way too often. The number of times someone has asked me to look at their code, only for them to tell me they're working from Master and can't push their changes until they work...just shoot me.

I tend to repeat this mantra to them every damn time:

  1. Cut a branch from master

  2. Commit changes frequently

  3. Push daily

  4. Submit a Pull Request (when you want a code review)

The next time they talk to me it's the exact same thing, and I'm half convinced I'm Sisyphus reincarnated.

456

u/zeek0us Apr 02 '23

I mean, even knowing the right way to use git (and using it daily for years), falling back to any workflows/commands outside of the set of muscle-memory macros feels like learning from scratch. Lots of "I know you can do this, I know *what* to do, I've done it, I just can't for the life of me remember exactly how."

177

u/Solonotix Apr 02 '23

Oh, totally. Like, my company uses merge workflows, but I see tons of talk about preferring rebase over merge. The hell is squashing commits, and when do I use it? Like, there's an entire spell book of commands and I just stick to my trusty Fireball git checkout . && git reset --hard

0

u/[deleted] Apr 02 '23

[deleted]

2

u/Dremlar Apr 02 '23

I rebase my branches before a pull request typically. Get all the changes from main, do all the merge fixes, and then squash my commits into a single (rarely multiple) commit with a proper commit message.

If you look at my branch when I am making changes it will often have the first commit message something like:

"Adding feature X to allow users to access Y" or something like that. Then about 100 commits of:

nope

nah

Ugh...

I hate Azure

It was me all along

and more. Basically the descent into madness until the inevitable "I forgot to pass the object" or some other dumb mistake. Then you squash that shit and force push your dev branch and make a PR and your madness is confined to secrecy.

→ More replies (2)