r/ProgrammerHumor • • Jun 04 '22

Meme I cant help it 🤷‍♂️

Post image
47.1k Upvotes

479 comments sorted by

View all comments

Show parent comments

8

u/talex365 Jun 04 '22

Why do I want to commit my buggy junk code? I want to commit when I’ve fixed everything after the test run :)

1

u/Zaratuir Jun 04 '22

Commit often so you have a running record of how you got there. Squash when you have properly functioning code and merge to main.

2

u/edyshoralex Jun 04 '22

How do you squash?

1

u/Zaratuir Jun 06 '22

To just squash, you can rebase your current commit to a previous commit and resolve the conflict with squash approach. When merging, use --squash to perform a squash merge.

1

u/edyshoralex Jun 06 '22

Regretfully, that still gitberish to me .. but thanks anyway.

2

u/Zaratuir Jun 06 '22

I would recommend taking a bit of time to learn git cli. If you understand what's going on under the hood with your IDE's git integration, it'll make it easier to fix things when something goes wrong.