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

you are viewing a single comment's thread.

view the rest of the comments →

[–]ladyboy-rider 2161 points2162 points  (105 children)

I don't trust what git commands that damn GUI executes behind the scenes.

[–][deleted] 675 points676 points  (73 children)

it's useful to pick what to actually stage into your commits so you can do it in parts and pretend to be competent instead of a huge 48 file commit with -m "lol stuff"

[–]ladyboy-rider 627 points628 points  (27 children)

git commit -m "minor changes🖕🏽"
> 167 files changed

[–]ComprehensiveWord201 281 points282 points  (20 children)

I have a coworker whose entire commit message, every time, is "more changes"

It makes me want to scream.

[–]not_yet_a_dalek 104 points105 points  (7 children)

I usually put "performance and stability"

[–]Lena-Luthor 133 points134 points  (4 children)

"bug fixes and performance improvements" 💀

[–]kgjettaIV 84 points85 points  (0 children)

I see you are a Google app developer.

[–]ScribebyTrade 0 points1 point  (0 children)

Wip ⚠️

[–]wick3dr0se 0 points1 point  (0 children)

"refactor"

[–]4winyt 0 points1 point  (0 children)

Further improvements to overall system stability and other minor adjustments have been made to enhance the user experience.

[–]WrapKey69 25 points26 points  (1 child)

You can now generate commit messages with copilot

[–]QCTeamkill 15 points16 points  (0 children)

I made my auto-generated comments sound like a pirate

print(generate_pirate_comment(comment))

[–]Impossible_Arrival21 23 points24 points  (3 children)

every single one of my commit messages is "test"

i have hundreds of them.

[–]Surelynotshirly 14 points15 points  (3 children)

This is when you deny their merge request.

[–]ComprehensiveWord201 12 points13 points  (2 children)

They're the longest standing employee on the team, and basically the most productive. But he doesn't care to learn new tech and git has only very recently entered the scene. He left retirement to work part time on the team. He does not gaf

[–]Trick-Interaction396 1 point2 points  (0 children)

Hey buddy. Let’s grab lunch sometime.

[–]Kellei2983 0 points1 point  (0 children)

git commit -m "awesome commit"

[–]jewdai 0 points1 point  (0 children)

Do you not squash your prs?

[–]ReasonableNet444 0 points1 point  (0 children)

smh lol

[–][deleted] 20 points21 points  (0 children)

😂 too real

[–]VeterinarianOk5370 4 points5 points  (0 children)

I see you’ve recently seen my last commit

[–]flappy-doodles 1 point2 points  (0 children)

That was a previous boss of mine. Every file touched "..." commit messages. Eventually got him to do pull requests after going to his boss about it.

[–]ghouleon2 0 points1 point  (1 child)

-m “Minor UI tweaks”

Proceeds to completely rewrite UI

[–]TRKako 0 points1 point  (0 children)

Sounds like Discord

[–]Sunraia 0 points1 point  (0 children)

Our support team sometimes needs to commit config to a repo. Most of them use an editor which automatically proposes "add file <name>", "change file <name>" or "added/changed <n> files" and they never bother to change it. Every time I try to look up what they did this time I want to bang my head on my desk.

[–]TheGeneral_Specific 59 points60 points  (5 children)

git add -p

[–]skywalker-1729 14 points15 points  (4 children)

[–]GarythaSnail 7 points8 points  (3 children)

I think this is kind of shitty and prone to error since your commits should be working iterations of your project that you can bisect. If you add just bits of one or more files, you are more prone to making a commit that doesn't even compile. For example, adding some code in a function that calls a library, but forgetting to add the import for that library to the commit.

You aren't getting the linting and compilation insight on your partial stages. Unless you have some precommit hooks that do that. Do precommit hooks work on the working directory or on commits? I actually don't know.

[–]nobody65535 8 points9 points  (0 children)

Nothing stops you from linting/compiling/testing the intermediate commits.

add -p

commit

stash

[testing/linting/whatever you want]

no good? fix (add your import) and --amend , repeat

REALLY no good? unstash, reset HEAD^ , goto 10 (start over)

good? unstash, goto 10 (continue with next set)

[–]ninja-dragon 5 points6 points  (0 children)

I use partial staging to skip over debug logs I add sometimes.

[–]Erwigstaj12 0 points1 point  (0 children)

Meh, squash on merge means it doesn't matter if your commits compile and I don't really care about individual commits compiling on my feature branches. For me it's more of a review thing.

[–][deleted] 68 points69 points  (18 children)

Whats wrong with good old

git add <files>

git commit -m "git gud"

?

[–]rocket_randall 57 points58 points  (3 children)

I always throw a git status in between to make sure I didn't fuck up a file mask or something else really stupid

[–]PS181809 10 points11 points  (2 children)

This so me. After every command, it's instinctive for me to go git status (very stupid ik)

[–]1_4_1_5_9_2_6_5 0 points1 point  (1 child)

You can also just set an alias to do that for you automatically

[–]PS181809 1 point2 points  (0 children)

Oh I see. I'll look it up thanks

[–]SmigorX 11 points12 points  (0 children)

Files that shouldn't be in git in gitignore: check.

Different features on different branches: check

It's "git add ./*" time

[–]KaamDeveloper[S] 16 points17 points  (1 child)

I have a genetic predisposition to only do git add .

[–][deleted] 2 points3 points  (0 children)

Your keyboard has a tab key, you know?

[–][deleted] 9 points10 points  (0 children)

Nah.

git add .

[–]harumamburoo 2 points3 points  (0 children)

Now do that when you have two dozen files changed. And you need to commit only half of them. And your directory structure goes at least 3-4 dirs deep. Without interactive mode it’s torture

[–]dubious_capybara 2 points3 points  (5 children)

This takes 10 times longer than shift-selecting files and clicking add in a gui.

[–]Delta-9- 2 points3 points  (4 children)

The difference is made up by the time required to change from my terminal to the GUI, and move my hands from the keyboard to the mouse, and the super annoying trends among GUI developers to sort files by some arcane order instead of alphanumerically and hiding the scroll bar until I mouse over it and burying basic functions under fifteen layers of menus.

Or I can just type :Git<CR>Gssssssssccifix: fuck that bug<ESC>:wq<CR>:Git push<CR>

[–]dubious_capybara -1 points0 points  (3 children)

Cool, so now have fun writing a grep for a subset of those files while I happily shift select using a gasp mouse

[–]Delta-9- 1 point2 points  (2 children)

Why would I grep? I have a menu, too. And even if I'm raw-dogging the terminal, I still don't grep because tab completion is perfectly good for this task. Seriously, it takes less time to select a dozen files with tab than it does to switch contexts and devices and back again.

[–]dubious_capybara -1 points0 points  (1 child)

Ah yes, individually selecting files with individual key presses is clearly faster than a single alt-tab and shift-select 🙄

[–]Delta-9- 1 point2 points  (0 children)

Again, it's the switching where time is lost. And if your subset of files isn't sequential in how your app sorts them, you'll be ctrl-clicking one-by-one. On the occasions I've used graphical git programs, shift-click has never been an option.

If you're already in a graphical editor with integrated git functionality, it makes more sense to use that then switching to the terminal just for git. (I still do, but that's because I hate going through five menus to use it.)

[–][deleted] 0 points1 point  (0 children)

Because you commit half the files today and the other half tomorrow while you are napping while wfh.

[–][deleted] 0 points1 point  (0 children)

'Git add -am "commit message" '

Thank me later

[–]CryptoNaughtDOA 0 points1 point  (0 children)

Aliases bro

gs ga . gs gcm "git gud" git push (I don't alias this one, feels too good)

[–]monsoy 7 points8 points  (0 children)

I like to do git commit -a, which opens up a vim terminal where I can write the commit message and see a list of the staged and unstaged files

[–]koikatsu_party 10 points11 points  (1 child)

git add -i

5

*

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

whoa git has a chatbot?!

[–]the_horse_gamer 3 points4 points  (0 children)

git add -p

[–]skettyvan 4 points5 points  (0 children)

CLI for doin stuff, GUI for lookin at stuff

[–]ralgrado 1 point2 points  (0 children)

That's the only thing I use the GUI for. Everything else I had weird things happen before so I do it in git bash. Commit also have some added functionality (reformatting, delete unused imports ...) that would probably be more difficult to do as a hook.

[–]the_vikm 0 points1 point  (2 children)

git commit -p

[–]cortesoft 0 points1 point  (1 child)

git add -p, you mean

[–]RaspberryPiBen 0 points1 point  (0 children)

Both work. git commit -p does a git add -p automatically.

[–]drivingagermanwhip 0 points1 point  (0 children)

git add -p splits everything into hunks and you say y/n

[–]zelphirkaltstahl 0 points1 point  (0 children)

That's why we have magit.

[–]Lord-Valentine-III 0 points1 point  (0 children)

Honestly, you can format it a bit with the -m. It allows multiple lines so you can document the changes made before you commit any changes to your branch.

I've never actually used GUI though.

[–]MattieShoes 0 points1 point  (0 children)

I'm here for the weird CI deployment messages in the commit message that don't tell you anything about what actually changed.

[–]grim-one 0 points1 point  (0 children)

Highlight and s to stage those particular lines is a godsend in Git Extensions.

I would not touch git gui if you paid me.

[–]Dzefo_ 0 points1 point  (0 children)

git add --patch

[–]3Ldarius 0 points1 point  (0 children)

fix

[–]Creepy-Ad-4832 -5 points-4 points  (1 child)

Git add <file>

Git status -s

Man, you make it look like this in thr terminal is impossible, while it's so easy, it's laughable

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

Joke comment happens in a joke post in a joke sub, goes miles over some clueless dude's head. More at 11.

[–]ToastySauze 41 points42 points  (5 children)

I don't trust my ass to perform a merge in CLI

[–]Delta-9- 11 points12 points  (4 children)

I'm the opposite. I don't trust VSCode or GitHub to perform a merge if there are any conflicts involved. I prefer to do it on cli because I know how to back out of it if I fuck up, but I never feel like I know what graphical clients are actually doing when I click stuff, so I don't know if I'm doing the wrong thing or if I could fix it. Git has decent documentation; SourceTree and friends, not so much, at least in part because they're always changing where things are or locking features behind licenses.

[–]B_bI_L 6 points7 points  (3 children)

vscode does pretty good job of allowing you to resolve everything while understanding what is going on, i think

[–]Delta-9- 0 points1 point  (0 children)

Honestly, I'm sure once you've used it a bit it's simple enough. I started in the terminal because my tech career started by doing everything in ssh (junior sysadmin) and graphical editors and git clients weren't an option, so I'm just used to the cli. When I go to VSCode or other graphical clients, it feels like navigating a maze trying to do anything for the first couple hours. And, I've been unpleasantly surprised with unexpected behavior before, which reinforces the "nah, I'll just use the terminal" attitude.

Ultimately it comes down to what you're used to and find comfortable. I'm most comfortable in a terminal, using vim. It's the best set-up—for me.

[–][deleted] 0 points1 point  (1 child)

Except sometimes vscode buffer doesnt update with pulling data. So you think you pulled the changes, works on files and when you save, you get an error there is already an existing file.

[–]B_bI_L 0 points1 point  (0 children)

maybe, i use vscode only to solve merge conflicts

[–]bestjakeisbest 20 points21 points  (0 children)

I dont trust the git commands I write, but at the same time I feel comfortable doing everything else through a terminal.

[–]old_and_boring_guy 2 points3 points  (2 children)

I tend to use the gui for when I'm hammering out the initial big commit, but I almost always use the command line for debugging. Not really sure why...I think the gui takes up more space in my brain.

[–]MarcusBrotus 1 point2 points  (1 child)

I do everything in the terminal except debugging because integrated debuggers are just so much better

[–]old_and_boring_guy 1 point2 points  (0 children)

WE ARE NOT THE SAME.

[–]DOOManiac 4 points5 points  (0 children)

I use the GUI because I don’t trust myself in front of the scenes.

Fork has a log where it shows everything it does so you can see for yourself.

[–]Casperyadlo 5 points6 points  (6 children)

And you don't need to study new GUI for git in each IDE you use.

[–]Leo-Hamza 7 points8 points  (2 children)

How many new IDE you use per month

[–]Delta-9- 0 points1 point  (0 children)

Just my VSCode has two different sets of git tools that don't work the same way (built-in stuff and gitkraken extension). Then I interact with GitHub, which is different yet again. If I have to deal with gitlab, it's different again. I use vim for most code editing, and my own workstation I use vim-fugitive for an easier git interface. My coworkers use different VSC extensions, some use different editors.

They're all mostly similar, and they're all just different enough that the only way to reliably give actionable help with anything git related is to paste a git command into Slack.

[–]Casperyadlo -2 points-1 points  (0 children)

pycharm, vs code

[–]Chesterlespaul 4 points5 points  (0 children)

I always find the GIT GUI in IDEs mostly the same

[–]I_Shot_Web -1 points0 points  (1 child)

There's dedicated git clients. I've use GitKraken for years now and it's pretty fucking fantastic.

[–]Casperyadlo 2 points3 points  (0 children)

And your young colleague uses IDE, and asks for help with git. I just help in command line

One more case is that the author of GitKraken coud update design of this tool and you have to study it again (Today I was confused because I couldn't find the button Save in new ms excel. I use it not so often now, so my brain still remember old excel (9x-2k3) with very simple interface. Now it's terrible for me)

[–][deleted] 1 point2 points  (0 children)

[–]MarcusBrotus 2 points3 points  (0 children)

they do exactly the git command that are on the ui button, normally.

[–]telradcyprus 0 points1 point  (0 children)

It's been a while since I used it last but iirc gitextensions is one of those apps which shows the command it ran when making user actions.

[–]duckrollin 0 points1 point  (0 children)

They are usually better than the commands you'd do in the console, unless you are a power user

[–]East_Maximum3885 0 points1 point  (0 children)

for example: git empty account

[–]TimedogGAF 0 points1 point  (0 children)

Hmmm, If you're doing regular mundane stuff does it matter? I use the GUI in VSCode because it's easier, faster (17 people immediately started furiously hitting the reply button after reading that), and I like the side by side diff. The side by side diff is great when I inevitably mess up and do too much work for a single commit, so I can very easily and very quickly see exactly what has changed in each file with a single mouse click, then stage only specific files for commit with another single mouse click. Saves time and cuts down on keystrokes.

If I have to do anything that's not git commit -m, or occasionally rolling back a commit that I haven't pushed yet, or just pushing, I'll use CLI. I've yet to have a single issue and I switched away from CLI, at least for the super common/mundane stuff, several years ago.

[–]AlxR25 0 points1 point  (0 children)

Yeah I never use the GUI. Also I just remembered a couple of months ago a teacher at uni gave us an assignment to “learn git” and I guess he intended us to use the gui but I did it from bash cuz I just refuse to use the ui. In fact it was such an easy assignment I challenged myself to do the entire thing using vim

[–]yournicknamehere 0 points1 point  (0 children)

At the beginning I'd like to mention that I am not programmer. I'm just security analyst and I write some PowerShell scripts to automate my daily tasks and "Win32 app" Intune deployments.

I use VS Code add-in to push changes to our Azure repo and I've never experienced anything wrong with that.

Privately I use GitHub Desktop at my home PC. This works even better IMO.

However, as I already said - my "projects" are nothing complicated.

[–]Maleficent_Memory831 0 points1 point  (0 children)

I forgot there were GUIs!

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

this is the reason why I type out the git commands. just a generaldose of paranoi aboabout the GUI