ProgrammerHumor

gitIsSoEasy

gitIsSoEasy
https://i.redd.it/oeu3bsn2jndf1.png
Reddit

Discussion

zerossoul

git good.

1 day ago
spartan117S OP

gitGud

1 day ago
qruxxurq

Nah. Who else are we gonna git blame?

23 hours ago
ImmortanJoeMama

shaw

15 hours ago
zerossoul

adidas

15 hours ago
shadowjay5706

agave

8 hours ago
Vini2143

git commit --amend

git push --force

1 day ago
wanderduene02

Keeping the history clean by having only one commit 👌

1 day ago
FenrirBestDoggo

Called 'update'

1 day ago
Siankoo

Welcome to gerrit

21 hours ago
SnooWoofers6634

But now my commit has 2000 lines changed, 15 files removed and 10 added. What do I do now?

20 hours ago
thatsallweneed

What a rookie numbers

20 hours ago
bubblessqueeze

Even better: git commit --amend --no-edit

1 day ago
BS_BlackScout
:py::cs::js::ts:

I used to alias this one, I called it git apend (or append? Idk)

1 day ago
lotanis

I have it aliased to "git whoops". As in "whoops I forgot to remove that debug print".

22 hours ago
IrrerPolterer

That's gcane on my machine. Big fan of keeping branches clean, rewriting history is encouraged in our shop, as long as you're the only one working on your branch. 

1 day ago
AyrA_ch
:redditgold: x ∞

We just squash merge, so it doesn't matters how messy your branch is.

1 day ago
IrrerPolterer

Sure makes it easier. But I personally find it obscures too many details in history. I'd rather have a more detailed git blame... I get the approach, its just not one I'd prefer 

20 hours ago
flukus

I hate squash merging. Why was this changed? Because someone worked on feature X. That explains nothing.

13 hours ago
St0n3aH0LiC

I agree that squash merging isn’t ideal, but is better than getting 30 “fix”, “fix test”, “oops”, “fix lint” commits that show the embarrassing stream of consciousness development some devs do.

Luckily the squashed commit includes all of my different commit messages generally into one, so that data isn’t lost.

And with GitHub you can see the original commits in the context of the PR that is linked to the squash merged commit.

5 hours ago
hagnat
:p::py::ru:

i have a bunch of aliases on my git config, and `git amend` is the i used the most :)

i also have a `git nuke` command, which removes every branch but main/master/stage
and a `git prune` which lists the command i need to run to remove all merged branches from origin (still need to copy and paste them, because no fucking way do i trust git NOT to mess this up)

1 day ago
leadzor
:cs::js::py:

My hack to re-trigger CI.

17 hours ago
harryham1
:j::ts::py:

Or of you're feeling fancy, git push --force-with-lease

1 day ago
UntestedMethod

No. That is for children. Big dogs dgaf about with-lease.

1 day ago
anonymity_is_bliss

"I push now! Good luck everybody else!"

21 hours ago
invictus08

git add -u && git commit —amend —no-edit && git push -f origin HEAD

22 hours ago
random314

--amend --no-edit

1 day ago
ThisUserIsAFailure

Git status in between every command cuz why not

1 day ago
YetAnotherRCG

Gotta do it otherwise the files will trick me

1 day ago
adenzerda

git diff

Ah, right, that's all what was in this commit. Looks good.

…

git diff

16 hours ago
Vipitis

You can actually set that up as a script

17 hours ago
shinanzu

git pull git status git add . git commit -m “upd” git push

1 day ago
Igoory

git stash push git pull git stash pop

Very useful for cases where conflicts with local changes happen.

1 day ago
arzis_maxim

This way, it is easier to deal with merge conflicts for me

1 day ago
crankykong

I was wondering what git stash push does since I’ve never used it. Apparently it’s the same as just git stash

22 hours ago
__throw_error

Yea it is useful when you want to stash one file, e.g. git stash push main.c

21 hours ago
clownyfish

Can just use git pull --autostash

19 hours ago
bogz_dev
:g: :py: :js:

git gud -f scrub

1 day ago
scabbedwings

‘git commit -am “msg”’

Why many args when few possible

1 day ago
nexusSigma

It’s like when my last company couldn’t believe I didn’t use a gui to manage my commits. Just leave me and my commands alone man, I like them, they work, I know my lane 😭

1 day ago
kftsang
:py::msl::j:

Tbh sometimes I find the GUI more difficult to use than command lines

1 day ago
exoclipse
:powershell::j::vb:

I come from a sysadmin background and I just am more comfortable with CLI than GUI for 90% of tasks

1 day ago
No-Object2133

Same. It's also just drastically faster most times anyway.

1 day ago
VoidVer

GitHub desktop is navigable by a toddler

1 day ago
jryser

I’ve used it for pull/commit/push/checkout (the basics).

How is it for the more advanced stuff?

1 day ago
VoidVer

VSCode and Github desktop make resolving merge conflicts pretty easy. I don't know how you would do this without the GUI offered by VScode at a minimum for comparing diffs.

Cherrypicking commits or going back in time is easy. Stash is easy. Not sure really what else you would need.

1 day ago
vivec7

I do use VS Code for resolving merge conflicts, but everything else is done via CLI. I just learned that way, and it throws me whenever I see someone using a GUI for it. I tried using one once, and it lasted about half an hour.

21 hours ago
AnAwkwardSemicolon
:oc::sw::j::ts::js:

Yeah- that's the problem. It's not usable for any mildly complex task.

23 hours ago
VoidVer

Can you give me an example of a “complex task” scenario you encounter regularly? I work on a large team and we follow fairly strict rules about how/when to create branches and merge them. In several years I’ve never seen anything that the command line would be better suited for other than flexing on interns

23 hours ago
living_or_dead

Isnt flexing the main goal here? Everything else is secondary

22 hours ago
VoidVer

I'm trying to get a paycheck and spend as much time outside of that playing video games and rock climbing. Posturing is for peacocks.

22 hours ago
BogdanPradatu

I don't use gui at all with git, not because it's not suitable for complex tasks, but because I find gui too complex for me. I understand the commands, I know exactly what I need to type, but with the gui I have no idea what I need to do and what effects my actions will have. Don't want to spend time learning that as well.

21 hours ago
issamaysinalah

It's kinda cringe seeing devs scared of UIs. I use SourceTree for work, since our repos are in bitbucket, and I don't believe command line could be faster than just clicking stuff when you know what you're doing.

19 hours ago
SpinachKey9592

I am the only cli user at my current workplace with 30 Devs.

Guess who always gets called when someone fucks their shit up via VS Code or a Jetbrains IDE.

22 hours ago
RlyRlyBigMan

As a dev lead I empower my other members to find a way that works for them, but if they need my help with it then we're going to do it my way.

1 day ago
nexusSigma

Thats fair haha nobody wants to see the junior banging their head against a brick wall because theyre too stubborn to use a shovel and insist on digging with their bare hands

21 hours ago
gaymer_jerry

Meanwhile if I remember in college everyone raised their eyebrows if you dared use emacs over vim. There’s a definitely a superiority the less you used guis there

1 day ago
qruxxurq

Emacs is not a GUI app.

23 hours ago
aeltheos

Yup, Emacs is an Operating System

20 hours ago
LitrlyNoOne

Wow, I'm the only person I know who uses GUI for git. People always be giving me shit for it.

22 hours ago
Optimal_You6720

Anything you are familiar with and know how to use is good

21 hours ago
rexspook

Git is very powerful but imo if you need to use those complex features regularly you’re doing something wrong. Command line is the best way to use git imo. Keep it simple. The GUIs are all way more complex than they need to be

1 day ago
arpan3t

I’m in between a GUI and CLI with lazygit, a TUI. Since I’m in the terminal already it’s super convenient, easy to use and helpful to visualize what’s going on in the repo.

19 hours ago
atoponce
:js:

A little simplistic IMO. I find myself doing a lot of git fetch upstream, git checkout main, git merge upstream/main, git log, and git rebase -i.

1 day ago
sisisisi1997

Or my favourite git feature that is usually easier to do with CLI: rebasing without checking out the parent branch:

$ git fetch origin main:main $ git rebase main

1 day ago
False_Influence_9090

Agree completely. It’s a fun meme, but people that sloppy merge completely mess up the history log. You are doing it right 🫡

17 hours ago
ClipboardCopyPaste
:js::cs:

git push --force | kms

1 day ago
NoCryptographer414
:cp:

What is kms

1 day ago
Simple-Difference116

Kill myself

1 day ago
[deleted]

[deleted]

1 day ago
CrypticViper_

sudo apt install kms

1 day ago
User___Not_Found

Ahh rookie mistake...first do sudo apt update

1 day ago
cecil721

17 hours ago
Hot-Entrepreneur2934

git reset --hard

1 day ago
ryuzaki49

git reset --hard origin/branch_name

For when you totally fucked up your local branch and want to redo

1 day ago
Hot-Entrepreneur2934

Yup. Or, as I call that situation, Tuesday.

Edit: nixed a trailing 's'.

1 day ago
qruxxurq

rm -rf —no-preserve-root /

Then take a vacation.

23 hours ago
Zanos

There is so much fucking around with git history I could have avoided by just doing a hard reset and copying my changes back in. :/

20 hours ago
Cautious_Implement17

soft reset to the commit before the start of your local changes should resolve almost all of these issues, no?

19 hours ago
IR0NS2GHT

git reset --hard so i trick my githook to not run conan update on git pull from main

21 hours ago
averynicepirate

I also use: git clean -df

When reset hard doesn't get rid of stuff like folders

22 hours ago
spicy_juicy

Masters dont use branches then?

1 day ago
knvn8
:ts::js::cp::py:

Can't imagine life without branches and rebase

1 day ago
EducationalEgg4530

Git add; git commit -m; git push works perfectly well with branches, what are you on about?

1 day ago
Xywzel

You would likely need git switch, git branch or some of the extra parameters for commit and push for using branches

21 hours ago
johnothetree

I created and switched to the branch before doing work, i'll let the git push tell me what the full command is for pushing a new branch and just copy/paste ezpz

12 hours ago
RadicalDwntwnUrbnite

Unironically. Trunk Based Development is hot right now. Requires a CI pipeline with strong automated testing and judicious use of feature toggles.

Personally I prefer, Github flow (not gitflow), short lived feature branches and PRs to main with strong automated testing and some use of feature toggles.

gitflow/mulitple long lived branches is where most people's problems with git arise.

1 day ago
je386

I was in a team where we had task branches with PRs to story branches, and when these stories where done and approved, they where merged to master. We did not care about rebasing/ keeping the history clean, though.

1 day ago
NamityName

Where was this so I know not to apply there?

22 hours ago
qruxxurq

Dev religions are hilarious.

23 hours ago
emirm990

Same here, make branch, do some changes, update it from main and make PR. In 6 years and 3 companies, Github desktop was enough for me except for a few times that I needed some complex commands.

In one company we had main and dev branches, feature branches are made from dev, hotfix made from main. After feature is done, it is merged in the dev and main is merged in dev. After release is ready, main is updated from the dev and release is made.

1 day ago
crippledgiants

What you call github flow we just refer to as a flavor of trunk based at my company, but I also prefer it. We do a branch for each jira card, so they usually don't live longer than a week.

1 day ago
ILKLU

gitflow/mulitple long lived branches is where most people's problems with git arise.

100% agree

23 hours ago
Luna_Wolfxvi

It drives me insane, but my current boss just works out of main.

1 day ago
wskc

gst ga . gc -m "message"

1 day ago
pampuliopampam
:js::ts::terraform::gd:

Shocked to not see a single comment about git add -p

1 day ago
NFSNOOB

I like my PHPStorm buttons <3 :D

1 day ago
baltimooree

Except rebase cherrypick merge I didn't use anything from the long list in ny whole carrier

1 day ago
Sibula97

Sounds like you're working on a very simple system

1 day ago
lightvisuality

OP doesn't get git and needs to potray themselves as 145 IQ

1 day ago
DJT_for_mod4
:py:

pro tip: use

git commit -a -m 

# or use: git commit -am

No need for an additional command(git add . )

1 day ago
vermadas

Note that this will not add new untracked files.

1 day ago
facw00

Yeah but, git commit -am is two characters shorter...

20 hours ago
thecrius
:bash::terraform::ts::php::cp:

that's the right one

18 hours ago
DJT_for_mod4
:py:

Thanks for the code review.

15 hours ago
AcnologiaSD

my exact comment, had to scroll down so far to see this

1 day ago
pwn2own23

Lol why should someone expire the ref log!? It's like cutting your own safety net.

1 day ago
Mr_uhlus
:js:

I just click the plus button, the commit button, and the push button in VSCode

1 day ago
Volotor

I... er... use my IDE's inbuilt git tools.

1 day ago
ILKLU

100% fine

That said, it will be better for your career to know how to use git CLI because there are so many times you will need it when working with servers.

But using your IDE or GUI is still absolutely fine and can even be better in some ways.

23 hours ago
LaconicLacedaemonian

`git commit -am . && git push`

1 day ago
wkwkwkwkwkwkwk__
:py:, :r:, :js:, :msl:, :m:

git merge to prod without pull request 😂 so ez

1 day ago
e89dce12

git add --all && git commit --message "$(fortune -n 72 -s)"

1 day ago
MayoJam
:cp:

Super ultra pro hacker tip: you can use git commit -am and skip git add . this way - which saves you time you can use later for resolving merge conflicts.

1 day ago
TerdSandwich
:ts::js::msl:

far right only works if your whole team is on that level. otherwise you get stuck cleaning up the mess

1 day ago
recaffeinated

Anyone who rebases should be cast into the sea.

1 day ago
Diligent_Stretch_945

I am Jedi so I use more force

1 day ago
AcnologiaSD

git commit -a -m "" ?

1 day ago
qruxxurq

Bruh. That empty commit message isn’t even human. Step it up. At least do “Some changes.” See that proper capitalization and punctuation?? GOML

1 day ago
hollowman8904

git commit

git push

git good

19 hours ago
drumDev29

This is just cope for people bad at git

12 hours ago
TimeSuck5000

This is very inaccurate.

The middle git commands are a nonsense sequence. Why would one be using both git merge and git cherry pick? Never use git merge if you can avoid it. Also you only have to mess with the reflog unless you fucked up bad. I guess he’s crying because he’s got no fucking clue what is going on.

As for the top end of the bell curve. No git’s not that easy. You need to rebase, cherry pick, and even do an occasional reset. All that guy is doing is best creating merge conflicts or worst case breaking the build.

23 hours ago
madTerminator

palisiekurwa = !sh -c 'git add . && git commit -m \"palilo sie\" --no-gpg-sign --no-verify && git push --force && echo \"Ok, now RUN!\"'

https://github.com/jakubnabrdalik/gitkurwa/blob/master/configNSFW_PL

1 day ago
Hunknowow

My 25 years of experience senior -> "just use fork dude, we're not in paleolithic anymore"

1 day ago
six_six
:cs:

“TFS is easier”

“Noooo! You have to use git!”

“TFS is easier”

1 day ago
sisisisi1997

TFS is easier uses up all your fucking disk space because it stores a full copy of all branches locally

I fucking hated cleaning up after TFS.

1 day ago
SinglePanic

gcaa
gpsup

1 day ago
Blackhawk23
:g:

Alright but git commit amend no edit is goated

1 day ago
uibutton

I map to this graph so hard haha. 15 years in and I’m on the far right of it. 7 years ago, I was the middle part 😂😂😂

1 day ago
bbayne

I am so glad I get to use fork so I don't have to remember any of the advanced command syntax: https://git-fork.com/

1 day ago
snekk420

”I love my git history linear” - Any Java developer

1 day ago
spastical-mackerel

git is the Devil’s playground

1 day ago
mrgk21

I'd say the 2 most useful apart from your usual suspects are

Cherry pick and worktree

1 day ago
Glum_Cheesecake9859

when things go bad

git reset main

git commit -am "let's try again"

git push origin --force

1 day ago
Mooks79

git add -A more than git add . for me.

1 day ago
mw44118

$ git commit -a -m “WIP” 50 times a day

1 day ago
hagnat
:p::py::ru:

how does that quote goes ?
"90% of your userbase won't use 90% of the features on your application"

git has a ton of neat tools that help working with it,
but for most day-to-day activities, knowing how to commit code to a new branch and push to origin is more than enough

1 day ago
Worldly-Object9178

Damn, thanks for the --autosquash, time to stop prefixing all the "wip" commits with f!

1 day ago
buzz_shocker

git commit -a -m git push

1 day ago
Houdinii1984
:py::js::unreal::unity:

Been coding since the 90s. I barely know any git terminal commands. It's only when I really mess up that I start begging Google StackOverflow GPT how to do the git stuff.

1 day ago
bison92

Git Kraken

1 day ago
ryuzaki49

What kind of unholy strategy uses all that?

git rebase is not that hard (until you are rebasing changes that contradict each other) 

1 day ago
steve-7890

rebase with force push has many pitfalls. Dunno why people keep using it without just squashing stuff into master.

1 day ago
fucks_news_channel

oh, you mean you guys don't delete the repo and push the code to a new one if there's ever a conflict?

1 day ago
TheJimDim

Why make everything so complicated? The worst that I'll run into is a small merge conflict when pulling in changes and Ai have to do a git config pull.rebase false and manually check what I need to fix (this is why we have IDEs, people)

1 day ago
MichaelAceAnderson

All these memes come down to one simple thing, really:
If it's simple, it's the first thing you learn
Then you learn about more complicated things to really take full control
Then you have to make your work accessible to others and not waste time, so you keep it as simple as when you first learned about it

1 day ago
jonathan-schaaij

Shout out to lazygit. It makes everything in the center much more user friendly!

https://github.com/jesseduffield/lazygit

1 day ago
isnortmiloforsex

Well if you can organize your code this well and code it in one go.

1 day ago
surveypoodle

Didn't know there's a `replace` command.

1 day ago
rudboi12

I just use lazygit now. I forgot most git commands aside the main 3

23 hours ago
rover_G
:c::rust::ts::py::r::spring:

So what does the guy on the left do when his branch is behind origin/main? What does he do when there is a merge conflict?

23 hours ago
Arstanishe

i used to use those console commands, but now i do everything in intellij idea

23 hours ago
testroyer9
:cs:

git commit -a -m “minor changes; git push”

23 hours ago
Thenderick
:g:

Idk I just use the buttons in my IDE...

23 hours ago
20InMyHead
:sw:

If I’m spending time fucking around with git commands, I’m not writing the code for the app I’m supporting. Git interactions should be simple, pull/push, branch, merge, stash, commit. They should also be easy. That’s why I actual prefer a GUI like SourceTree. I know I can do more complex things on the command line, and when I need to I do, but most of the time I just want to see what I’m working with and get back to writing code. But ultimately you do you.

23 hours ago
jester32

I might be on the left, but I can’t be convinced git cherry-pick is a real command.

22 hours ago
lookarious

I use GUI for Git

22 hours ago
LitrlyNoOne

I had a manager once who insisted we put in extra effort to keep the git history clean. No reason. He just liked how it looked.

Pound sand, Cody. Your opinions were trash.

22 hours ago
Smalltalker-80

Or: [ Commit button ] click 1, [ Push button ] click 2.

22 hours ago
Suspicious_Jacket463

git pull --rebase

22 hours ago
doSmartEgg

git pull, git add, git commit -m, git push -u origin main. 🗣️

21 hours ago
redshadow90

Proud to be on the left side of the meme (except pull, rebase, commit message, force push)

21 hours ago
itzNukeey
:p:

My rule of thumb is - do whatever the fuck you want in your branch but when you merge to master, squash the commits

21 hours ago
anoldoldman

git reset --soft HEAD~n is the best way to squash n commits and I'll die on this hill.

21 hours ago
fr33d4n

Rebase from develop/master should be mandatory before doing a PR.

One commit features (using ammends or rebase -i) should be mandatory before doing a PR

ff-only merges, at least between master and develop should be mandatory

pulling should be banned (git fetch + rebase is miles better)

21 hours ago
123m4d

git add -A

20 hours ago
cheezballs

I've been using git regularly for ten years now, I've still yet to ever hit the middle part of the curve.

Edit: with proper branching, though

20 hours ago
Fryndlz

Git ignore plz

20 hours ago
bunkbedss

which one am i?

20 hours ago
nicer-dude

And my dumb ass is alwasy using git add -A

20 hours ago
tamboril
:cp:

at first there are mountains
then there are no mountains
then there are mountains again

20 hours ago
TallGreenhouseGuy

https://stevebennett.me/2012/02/24/10-things-i-hate-about-git/

20 hours ago
Specialist_Brain841

posts like this generate comments that are great for training LLMs

20 hours ago
AbouMba

Am I the only one who uses git add --all instead of git add . ? I am a junior dev

19 hours ago
n00dle_king

Nah you gotta rebase before you push.

19 hours ago
oosacker

git add * git commit -m "initial commit" git push --force

19 hours ago
thecrius
:bash::terraform::ts::php::cp:

git commit -am gang rise up

19 hours ago
nickchomey

Jujutsu + jjui ftw

18 hours ago
Kiwithegaylord

You’d expect the 3p1|< |-|4x0/> would’ve automated things by now with is mad NodeJS skills he learnt at totallynotascam bootcamp

17 hours ago
SuchTarget2782

Been using git for 12 years and train other people on it.

Add/commit/push and pull/rebase/push are basically 99.9% of my git commands.

17 hours ago
braindigitalis
:cp::c::asm::p::unreal::msl:

git commit -am "misc changes"

git push --force

16 hours ago
2hands10fingers
:py: :js: :p:

git merge —abort

My hero

15 hours ago
Bowshewicz

I'm the middle guy. What insights will turn me into the right side guy?

15 hours ago
Sea_Budget378

alias gang wya

15 hours ago
kbegiedza
:cs:

I used to dance around git rebase, do weird shit, but after all it doesn't matter
add, commit, push.
often the better

15 hours ago
PreInfinityTV

ga, gcm, gpush

14 hours ago
canihelpyoubreakthat

Cope newb

14 hours ago
nikola_tesler

Ok ok, but worktrees are pretty dope

14 hours ago
mateowatata

lg a c types message enter P Ctrl + c

11 hours ago
ButcherZV

There are more commands than add, commit & push?!?!? Whaaat? 🤣

9 hours ago
TheKeyboardChan
:g:

2025, do people still use git in the terminal?

9 hours ago
chenverdent

I have delegated git to AI, so far I'm a very happy branch manager.

8 hours ago
Ze_Kap
:ts:

lazygit

7 hours ago
Splatpope
:c::cp::py::lua::bash:

op's history graph : https://imgur.com/a/tnRw9yF

haha wait no that's my team's :(

7 hours ago
8g6_ryu

lol I even have a custom cmd in my bash rc

git_up_repo() {
git add .
git commit -m "$1"
git push
}

7 hours ago
DustofLogic

real

6 hours ago
comediehero

Just use lazygit

6 hours ago
Marc_Alx
:cs:

Skill issue...

Good luck working in a dev team without merging/rebase.

5 hours ago