90 points

So you’re going to git gud?

permalink
report
reply
38 points

git out

permalink
report
parent
reply

git your pants

permalink
report
parent
reply
1 point
Deleted by creator
permalink
report
parent
reply
71 points

if u ever get a tricky merge conflict, just git push --force. this automatically works out the right code to keep (your own)

permalink
report
reply
15 points

Also, a way to never have to work again!

permalink
report
parent
reply
8 points

Except if you’re an employer in a very small company.

Source: my boss did this at the first company I worked at.

permalink
report
parent
reply
65 points

Highly recommend bookmarking https://ohshitgit.com, it’ll steer you right 👍

permalink
report
reply
55 points
  1. git pull
  2. git reset --hard HEAD
  3. try not to cry
  4. cry a lot
permalink
report
reply
17 points

git reflog, you can get your old commits back

permalink
report
parent
reply
15 points

But I want to pretend none of this ever happened.

permalink
report
parent
reply
6 points
git can we just pretend the last 30 minutes never happened

I feel like that would get more use than people want to admit.

permalink
report
parent
reply
36 points

lemme rebase the main branch onto my branch.

two minutes later

1 merge conflict of 57 [abort] [continue]

permalink
report
reply
13 points

this is easily fixed by copy pasting the files into a new directory and never opening git again out of fear

permalink
report
parent
reply
12 points

Project managers hate this one weird trick!

permalink
report
parent
reply
7 points

One key thing that can help you wrap your head around rebasing is that branches get switched while you’re doing it; so, say you’re on branch feature and do git rebase master, for any merge conflict, whatever’s marked “current” will be on master and what’s “incoming” is from feature.

There’s also git rerere that should in theory remember a resolution you do between two branches and reuse it every time after the first; I’ve rarely used it in practice; it would happen for long lived branches that don’t get merged.

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

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

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 5.1K

    Monthly active users

  • 1.5K

    Posts

  • 33K

    Comments