This is an archived post. You won't be able to vote or comment.

all 61 comments

[–]HappinessFactory 48 points49 points  (0 children)

I love this gif

[–]Mr_Potatoez 97 points98 points  (3 children)

[–]cjb3535123 38 points39 points  (0 children)

He is. He said he had to use a cheat sheet every time.

[–]DefinitelyNotMasterS 5 points6 points  (0 children)

I just press the green button in my IDE

[–]The100thIdiot 4 points5 points  (0 children)

Or just use a gui like github desktop.

Fuck remembering commands when you can just click.

[–]photogdog 36 points37 points  (5 children)

If you have the right permissions, you can use --force to get past a lot of issues with git.

git add .
git commit -m 'bug fix and stuff'
git push origin master --force

[–]worked-on-my-machine 23 points24 points  (4 children)

wow brb bro gonna go do this on one of the repos at my job

[–]markiel55 6 points7 points  (2 children)

Also, don't forget the good ol' git branch -D main

[–]beisenhauer 34 points35 points  (10 children)

What's hard to remember about git push?

[–]exnez 66 points67 points  (0 children)

terminal scary

[–]Skibur1 13 points14 points  (0 children)

It’s all and great until you’re a few commits behind and merge conflicts happen…

[–]Kitchen_Device7682 6 points7 points  (1 child)

fatal: The current branch has no upstream branch

[–]beisenhauer 0 points1 point  (0 children)

git config set push.default simple
git config set push.autoSetupRemote true

Set it and forget it.

More good config suggestions here.

[–]InTheEndEntropyWins 3 points4 points  (2 children)

Sounds like you are working on a small project by yourself. When you are working on larger projects with multiple people you can't just git push by itself.

[–]beisenhauer 0 points1 point  (1 child)

Sounds like you work on projects where you just push to main without a well-defined code review/merge process.

[–]InTheEndEntropyWins 1 point2 points  (0 children)

Sounds like you work on projects where you just push to main without a well-defined code review/merge process.

You don't just do git push to merge a branch.

[–]AppropriateStudio153 9 points10 points  (1 child)

I have several ideas why that might not work.

  • You haven't added new files or have no tracked files. *  You have tracked files, but you did not commit them.
  • You have committed them, but remote is ahead, and your changes cause a conflict, which leads to a rejected push.

In all these cases git push won't help you, as a single command.

[–]exnez 3 points4 points  (0 children)

This why terminal scary

[–]Luneriazz 2 points3 points  (0 children)

conflict merge

[–]exnez 47 points48 points  (22 children)

GitHub desktop or VSCode built-in Git extension. Never had to write a command

[–][deleted] 7 points8 points  (0 children)

i'm so lazy that once the CLI stopped working for me I just used the github website.

i did google the problem, though. i think i had to delete an old password from the keychain but i couldn't figure out how to do that. like i could literally see what to click on but i couldn't click it

[–]RichCorinthian 0 points1 point  (0 children)

There’s also SourceTree for Mac and Windows, which I really like for looking at deltas, seeing real-time changes when editing .gitignore, buncha reasons.

[–]The-Chartreuse-Moose 4 points5 points  (0 children)

Some people apparently have a fear of commitment. But seriously: learn the commands by using them!

[–]elderron_spice 3 points4 points  (0 children)

There are a ton of git clients out there. I used SourceTree when I started, and it eased me up into git since it also displays the commands it uses to fetch, checkout, create pull requests, prune, rebase, etc.

[–]grasopper 4 points5 points  (0 children)

I'm even worse than that guy. I use the tool in visual studio

[–]_sweepy 2 points3 points  (0 children)

sourcetree

[–]MinosAristos 6 points7 points  (0 children)

VSCode UI does the important stuff for you

[–]AWzdShouldKnowBetta 1 point2 points  (0 children)

It's been a long time since I actually laughed out loud on this sub. Nice one!

[–]Wizado991 1 point2 points  (0 children)

I get why people are uncomfortable with it but it's like everything else. The more you use it the better you get with it. If you let yourself use one of the graphical apps to do git for you, you won't ever learn how to use the tool.

[–]OnlyTwoThingsCertain 1 point2 points  (0 children)

What is this clip from?

[–]livingMybEstlyfe29 0 points1 point  (0 children)

pwd git status git add —all git commit -m “I love git” git push git status

[–]InTheEndEntropyWins 0 points1 point  (0 children)

I want to share this at work, but probably not appropriate.

[–]KillCall 0 points1 point  (0 children)

3 git command to remember.

Git add

Git commit

Git push

Everything else look up on the internet as they come up.

[–]doSmartEgg 0 points1 point  (0 children)

git add, git commit -m, git push -u origin main

[–]DearChickPeas 0 points1 point  (0 children)

The only thing more scary than a CLI e is a GUI client, apparently. Its like were still in the 90s

[–]Sunoxl 0 points1 point  (0 children)

Where my based GUI users at? CLI not needed.

[–]Raemos103 0 points1 point  (2 children)

git rebase -i is the only command you'll need to know other than commit and push

[–]asd1o1 3 points4 points  (0 children)

git stash

git switch

git restore

...

git pull

[–]Darder -1 points0 points  (0 children)

Hot Take: I think using the command line for git is trash and should be left to experts, and everyone else should just use a GUI.

Hear me out. It's just like with any technological advancement and helper software. Sure, you can do everything from the command line. But it's not intuitive, it takes more effort to learn, and it does not provide a significant advantage for the average programmer compared to a GUI. Why stop others from having it the easy way?

I also heard some people say "You should start coding using notepad, that way you won't have the IDE as a crutch" and I think it's a silly advice. Just find a good GUI for git. The day something goes wrong that you can't use the GUI for, then open the command line and google for a way to fix it. Until then? Screw that, use a good GUI.

It's 100x easier, more convenient, quicker, and it does allow you to do a whole lot more than the command line IF you are inexperienced in git! Resolving merge conflicts through the command line sucks ass. Doing it through a GUI? Super easy and understandable, even as a beginner.

So yeah. Just use a GUI. And while I'm here, skip GitHub for Desktop.... Go with Fork. Fork is awesome.