this post was submitted on 09 Nov 2023
1081 points (98.1% liked)

Programmer Humor

32480 readers
325 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] aniki@lemm.ee -1 points 1 year ago (3 children)

this is bad advice. Never force git to do anything. If you're forcing something you're doing it wrong.

you can always git fetch -a; git merge -X theirs remote-branch or rebase your branch.

[–] jjjalljs@ttrpg.network 3 points 1 year ago

If I get a big conflict and I know my change is trivial, I feel perfectly okay doing git fetch git reset --hard whatever and then reapplying my simple change as a new commit. Sort of a bootleg rebate.

[–] zalgotext@sh.itjust.works 1 points 1 year ago

If you use a squash workflow, you're going to be force pushing a ton.

Never force git to do anything. If you're forcing something you're doing it wrong.

This is bad advice. Better advice would be "know and understand your tool, and know the consequences of your actions".

[–] erogenouswarzone@lemmy.ml 1 points 1 year ago

I hear what you're saying.

First, I hard disagree with you. Overwriting my local version of code is a parachute - not an ideal landing, but better than merging by hand.

Also, my comment was not an attempt to teach everything about git, just to explain what is happening in simple terms, since git requires a lot of experience to understand what those messages mean.