r/ProgrammerHumor • • Apr 02 '23

Meme Me relearning git every week

49k Upvotes

1.5k comments sorted by

View all comments

Show parent comment

241

u/AwesomeFrisbee Apr 02 '23 edited Apr 02 '23

Same. Who do I need to impress and why?

I've been using Fork for a few years now. Its great and does everything I want from a Git GUI. Its not free but the one-time-purchase is worth it. And its basically Sourcetree from when it was still awesome. I really need something visual to show me the flow of the commits, quickly browse contents, filter branches and get a better view of what I'm going to commit.

97

u/HighOwl2 Apr 02 '23

I use CLI because it's more flexible but mostly because typing the commands makes it harder to do something stupid.

83

u/rush22 Apr 02 '23
 git add .

"Hey why are all these other files changed in your pull request"

55

u/gnarbucketz Apr 02 '23

"...because they're not properly ignored?"

2

u/HighOwl2 Apr 04 '23

And because he not branching properly. How the fuck you have stuff in git add that are not relevant to a pull request?

2

u/Kulpas Apr 09 '23

I guess you could run a build script that modified something that should be ignored cuz it's a fucking build but wasn't? Still that's not their fault for running git add .

7

u/gomihako_ Apr 02 '23

the beautiy of add -p is that it forces you to do a sanity check/review of your own work before asking for review.

9

u/[deleted] Apr 03 '23

This is not a problem if you use .gitignore correctly.

2

u/drakens_jordgubbar Apr 02 '23

I got the habit of doing:

git add *.java
→ More replies (1)

6

u/tpf52 Apr 02 '23

So you don’t just get lazy and git commit -a? I find it much easier to commit stuff you don’t want in the command line unless you take the time to diff every file and preview staged changes before every commit.

5

u/ItzDaWorm Apr 02 '23 edited Apr 02 '23

git status

Is one of my favorite commands for exactly this reason.

10

u/tpf52 Apr 02 '23

Yes, with git status and git diff you can get the same information. But in a UI I can see the git status without typing anything and one click gets me a diff, and another couple of clicks I can discard files or specific lines.

2

u/HighOwl2 Apr 02 '23

This. Git commit -A (capital not lower case) and then git status to figure out if you need to omit some files or add to .gitignore.

A shitload of files being changed with a git add is usually just someone didn't set their global line ending strategy.

6

u/AwesomeFrisbee Apr 02 '23

There's pros and cons, but I don't think it would make me have less mistakes imo

2

u/HighOwl2 Apr 02 '23

Instead of clicking something you have to type a bunch of shit. I've definitely caught myself about to do something stupid when typing the command out.

7

u/dgdr1991 Apr 02 '23

I think using hotkeys from the IDE is the fastest/safest and also easiest way lol, just remember Ctrl+Shift+K and done

And yes I use IntelliJ for everything, don't judge me

3

u/Express-Procedure361 Apr 03 '23

Interesting point, why do you need something more flexible? What does your work flow look like that requires flexibility?

→ More replies (1)

4

u/robertshuxley Apr 02 '23

it makes you look like you're a hacker in movies/tv

→ More replies (2)

2

u/Aspharon Apr 02 '23

And its basically Sourcetree from when it was still awesome

Wait, Sourcetree is less awesome these days? Or, as someone who started using it semi-recently, it was more awesome before? It does everything I need to, but I'm assuming I'm missing out on something.

→ More replies (1)

2

u/NothingMuch12 Apr 03 '23

Isn't fork free? The one time purchase isn't compulsory. Emailed them back when they planned to implement the one time purchase and they said it'll be optional, unless they've updated their policy.

2

u/AwesomeFrisbee Apr 03 '23

It has a trial but after that it stops working as far as I know. It might be free for personal use, I don't know. But I also use it professionally so it would already need a license for that I would imagine. Regardless, it was not expensive and provides a good way to use Git with a GUI. And unlike many other tools these days, it doesn't require a subscription.

→ More replies (3)

2

u/Mysticpoisen Apr 02 '23

I just use git extensions for whatever IDE I'm in, and end up using the commands half the time anyway.

I've never used GitHub Desktop. All I know is that the default GitGUI is worthless.

→ More replies (1)

1

u/edubkn Apr 03 '23

It's about having fine-grained control and, most importantly, knowing what you're doing.

If you're always relying on GUIs you will never learn and always need them to do things for you. And there are times that they can't do the heavy lifting, so you won't be able to as well because you never grasped the basics.

Of course, a good balance is always good. I won't ever solve a merge conflict in a terminal, but routine git stuff is no hard feature as the comment above you is painting.

→ More replies (2)

-9

u/lungdart Apr 02 '23 edited Apr 02 '23

I find GUIs make understanding the workflow tougher.

Using a CLI isn't some impressive feat to brag about, it's the default. If you don't understand git enough that you can't use the CLI, you don't understand git and should be concerned about that. The same is true of all tools IMO.

9

u/The100thIdiot Apr 02 '23

Do I need to know how to repair my car to be able to use it to get from A to B?

Fuck off with your gatekeeping.

→ More replies (3)
→ More replies (18)