ProgrammerHumor

gitIsSoEasy

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

Discussion

Vini2143

git commit --amend

git push --force

3 hours ago
wanderduene02

Keeping the history clean by having only one commit 👌

3 hours ago
FenrirBestDoggo

Called 'update'

1 hour ago
bubblessqueeze

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

2 hours ago
BS_BlackScout
:py::cs::js::ts:

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

2 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. 

2 hours ago
AyrA_ch
:redditgold: x ∞

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

1 hour 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)

2 hours ago
random314

--amend --no-edit

2 hours ago
harryham1
:j::ts::py:

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

2 hours ago
UntestedMethod

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

2 hours ago
Ratatoski

I do a bunch on my own branches when I've not yet set up a PR for review. I like to do granular commits and sometimes I miss a file that belongs to a commit I just made.

28 minutes ago
shinanzu

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

3 hours ago
Igoory

git stash push git pull git stash pop

Very useful for cases where conflicts with local changes happen.

2 hours ago
arzis_maxim

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

2 hours ago
scabbedwings

‘git commit -am “msg”’

Why many args when few possible

2 hours ago
bogz_dev
:g: :py: :js:

git gud -f scrub

1 hour 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 😭

3 hours ago
kftsang
:py::msl::j:

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

2 hours 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

2 hours ago
No-Object2133

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

1 hour ago
ILKLU

No it's not. I use a combination of CLI and GUI and for most basic stuff GUI is faster. Maybe your repo is super basic and your branch names are 1 or 2 characters long (or you don't use branches at all) so it's quick to type stuff. There's no way I'm typing out a 20+ character branch name in one pass without any typos, faster than it takes me to make a couple of clicks.

51 minutes ago
No-Object2133

.... you know you can tab complete branch names right?

50 minutes ago
ILKLU

I just use a vanilla bash terminal so no can do

12 minutes ago
Alarmed_Allele

does that work on windows cmd?

46 minutes ago
exoclipse
:powershell::j::vb:

use powershell instead of the command prompt and it does

41 minutes ago
No-Object2133

Unsure, I use zsh on osx and linux, and wsl a zsh if i need to do work on windows.

45 minutes ago
VoidVer

GitHub desktop is navigable by a toddler

2 hours ago
jryser

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

How is it for the more advanced stuff?

2 hours 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.

2 hours ago
dr-pickled-rick

This one doesn't vim

1 hour ago
VoidVer

What do you mean? Would using a different IDE better suited to a type of work I don't do create more complex use cases for git?

1 hour ago
viktorv9

Google's interface is too complicated for you as well?

1 hour ago
jryser

I’m asking what the user experience is like, not how to do it

1 hour ago
AnAwkwardSemicolon
:oc::sw::j::ts::js:

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

48 minutes 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

13 minutes ago
living_or_dead

Isnt flexing the main goal here? Everything else is secondary

4 minutes 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

2 hours ago
qruxxurq

Emacs is not a GUI app.

1 hour ago
mobyte

I used emacs in college out of spite but did come to the conclusion that it was better.

2 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.

2 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

2 hours ago
sage-longhorn

If it's Gooey I'm pretty sure that means you didn't bake it long enough but I guess some people are into that

1 hour ago
qruxxurq

It doesn’t always have to be rock hard.

1 hour ago
zerossoul

git good.

3 hours ago
spartan117S OP

gitGud

3 hours ago
qruxxurq

Nah. Who else are we gonna git blame?

1 hour ago
ThisUserIsAFailure

Git status in between every command cuz why not

3 hours ago
YetAnotherRCG

Gotta do it otherwise the files will trick me

2 hours ago
Hot-Entrepreneur2934

git reset --hard

3 hours ago
ryuzaki49

git reset --hard origin/branch_name

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

1 hour ago
Hot-Entrepreneur2934

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

Edit: nixed a trailing 's'.

1 hour ago
qruxxurq

rm -rf —no-preserve-root /

Then take a vacation.

1 hour ago
ClipboardCopyPaste
:js::cs:

git push --force | kms

3 hours ago
NoCryptographer414
:cp:

What is kms

3 hours ago
Simple-Difference116

Kill myself

2 hours ago
Aacron
:cp::m::py::jla:

kms is not recognized as a cmdlet or function

2 hours ago
CrypticViper_

sudo apt install kms

2 hours ago
User___Not_Found

Ahh rookie mistake...first do sudo apt update

2 hours ago
Davaluper

Kernel Mode Setting

But here it’s probably key management service for pasting keys

2 hours ago
exoclipse
:powershell::j::vb:

the software behind eve online's capsule system is much more straightforward than I could have imagined

2 hours ago
ILKLU

You should always use --force-with-lease as a precaution against overwriting recent commits from others. It should be the default in my opinion.

44 minutes ago
spicy_juicy

Masters dont use branches then?

3 hours ago
knvn8
:ts::js::cp::py:

Can't imagine life without branches and rebase

3 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.

2 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.

2 hours ago
steve-7890

What you described is not a feature branch, but just a branch.

Feature branch is when you keep development, and testing on a single branch until all work is done and only them merged to master (with no further manual tests).

That's why people say feature branches are bad, but branches per se are ok.

1 hour 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.

2 hours 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 hour ago
qruxxurq

Dev religions are hilarious.

57 minutes ago
ILKLU

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

100% agree

28 minutes ago
EducationalEgg4530

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

2 hours ago
Luna_Wolfxvi

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

2 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.

3 hours 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

2 hours ago
NFSNOOB

I like my PHPStorm buttons <3

3 hours ago
baltimooree

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

3 hours ago
wskc

gst ga . gc -m "message"

3 hours ago
pampuliopampam
:js::ts::terraform::gd:

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

2 hours ago
lightvisuality

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

3 hours ago
DJT_for_mod4
:py:

pro tip: use

git commit -a -m 

No need for an additional command(git add . )

2 hours ago
vermadas

Note that this will not add new untracked files.

1 hour ago
AcnologiaSD

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

2 hours ago
LaconicLacedaemonian

`git commit -am . && git push`

3 hours ago
CyDenied

Git is more difficult than JS tbh

3 hours 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.

2 hours ago
Sibula97

Sounds like you're working on a very simple system

2 hours 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

2 hours ago
AcnologiaSD

git commit -a -m "" ?

2 hours 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 hour ago
Mr_uhlus
:js:

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

1 hour ago
LobsterParade

SVN is better. No hassle with branches and all that. The only way Git would be better is by force pushing all changes to the master branch.

1 hour ago
ILKLU

You're fired

20 minutes ago
Volotor

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

1 hour 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.

16 minutes ago
MeinWaffles

I always laugh at how true this meme is because it’s so true 😂 I did these exact mistakes

57 minutes ago
olssoneerz

NGL. This is where your AI terminals come in pretty handy. I've been using the add, commit, push trio my entire career. When I need anything more complicated I used to look it up online (takes a few minutes) but now I just tell my terminal to do it and it does.

2 hours ago
Legitimate-Jaguar260

AI is for the weak

2 hours ago
olssoneerz

Refer to the meme. Strong jr dev energy you got there!

2 hours ago
wkwkwkwkwkwkwk__
:py:, :r:, :js:, :msl:, :m:

git merge to prod without PR 😂 so ez

3 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

3 hours ago
Hunknowow

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

3 hours ago
e89dce12

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

2 hours ago
six_six
:cs:

“TFS is easier”

“Noooo! You have to use git!”

“TFS is easier”

2 hours 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 hour ago
SinglePanic

gcaa
gpsup

2 hours ago
Blackhawk23
:g:

Alright but git commit amend no edit is goated

2 hours 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 😂😂😂

2 hours ago
pwn2own23

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

2 hours 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/

2 hours ago
snekk420

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

2 hours ago
spastical-mackerel

git is the Devil’s playground

2 hours ago
mrgk21

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

Cherry pick and worktree

2 hours ago
Glum_Cheesecake9859

when things go bad

git reset main

git commit -am "let's try again"

git push origin --force

2 hours ago
Mooks79

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

2 hours ago
mw44118

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

2 hours ago
qruxxurq

WIP too hard to type. Just do “…”.

1 hour ago
recaffeinated

Anyone who rebases should be cast into the sea.

2 hours ago
steve-7890

Worst thing: rebase and force push when working on a branch that gonna be sooner or later squashed into master.

I created a bunch of comments on a PR and guy just rebased and forced pushes changed. All comments gone, because commit ID changed....

1 hour 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

2 hours ago
Worldly-Object9178

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

2 hours ago
buzz_shocker

git commit -a -m git push

2 hours ago
Diligent_Stretch_945

I am Jedi so I use more force

2 hours 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.

2 hours ago
bison92

Git Kraken

2 hours ago
Amazing-Movie8382

I use sourcetree, does it count ?

1 hour 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 hour ago
steve-7890

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

1 hour 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 hour ago
qruxxurq

I just rewrite, sometimes in a different language, if there’s a conflict.

1 hour 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 hour 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 hour ago
jonathan-schaaij

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

https://github.com/jesseduffield/lazygit

1 hour ago
isnortmiloforsex

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

1 hour ago
surveypoodle

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

1 hour ago
rudboi12

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

1 hour 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?

1 hour ago
Arstanishe

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

49 minutes ago
testroyer9
:cs:

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

43 minutes 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.

21 minutes ago
Thenderick
:g:

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

18 minutes 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.

14 minutes ago
jester32

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

6 minutes ago
kurokinekoneko
:ts::cat_blep:

If only I could just teach 3 commands to someone and they never call me again...

This stuff only works if you work alone... I don't see the point of the meme. People who can't work with others are not on the right side.

2 hours ago
Chrazzer

Are y'all really manually typing all these git commands all the time? Every modern IDE has a git integration. Makes all of this pretty easy and quick. Even faster if you're using the keyboard shortcuts

3 hours ago
woodycodeblue

Not all those commands, but yes. My IDE has git integration like you said but I prefer to do my gitting in the command line.

It could work fine for the basic flow, but I do enough non-standard stuff that git integrations feel stifling.

3 hours ago
the_horse_gamer

most git GUIs do not give you access to most of the commands in that list

yes, I type them every time. I know what I want to do, and I know what each option does, so I know what I need to type.

and I have aliases for the commands I use often. like sup for submodule update --init --recursive, because I work with submodules a lot.

3 hours ago
gaymer_jerry

At that point why not just make a bash/shell file at that point if you are writing the same 10+ commands over and over for every git usage

2 hours ago
the_horse_gamer

that's what git aliases are for.

2 hours ago
gaymer_jerry

But doesn’t a git alias only shorten a single command not a series of commands or was I unaware it can shorten a series of commands

2 hours ago
the_horse_gamer

by prepending ! you can start doing shell commands. so you can use && or take arguments.

an example alias i have: hotfix for !git add . && git commit --amend --no-edit

an example of taking arguments: dry-merge is !git merge --no-commit --no-ff $1 && git merge --abort &&:

usually tho, you only need to shorten 1 command. like i have sup for submodule --update --recursive

1 hour ago
Alphasite

I’ve yet to use a bit gui that doesn’t have some glaring hole that requires stepping back to the cli. Even source tree.

3 hours ago
darlingsweetboy

as if typing commands is some laborious task lmao

2 hours ago
No-AI-Comment

Atuin

3 hours ago
brandi_Iove

i use vs for that. yeah, i‘m the guy on the left

3 hours ago
gaymer_jerry

How to tell if your ide has prebuilt git integration. Did your project generate with a gitignore file? Perfect it definitely has git integration. I can’t think of a single ide that doesn’t generate a gitignore file either.

2 hours ago
SecurePlate3122

I like zsh with git plugin.

ga . gc -m  gp

2 hours ago
je386

Most of them, yes. I like to know the commands so I can work even on another computer.

At least the usual pull, add, commit, push, rebase is something I use very often.

When it comes to cherry-picking, I as the brits.
Just joking, I use girk for that.

And for switching between local branches, I use the function of intelliJ, but I am quite sure that it is
git checkput [branch name]

2 hours ago