17
nururururu
260d

If you just git add . by instinct, you're already dead inside

Instead, consider checking out the diffs of your changes before staging them, and then stage the files or directories individually

Of course I'm saying this to complain about my colleagues who stage and commit things they shouldn't, it probably doesn't apply to small side projects, but staging individually is probably a good habit to have

Comments
  • 6
    just don't change other files

    if you do, stash them
  • 6
    I run git status before hand, and if there are files listed I didn't expect, I investigate.

    Partial stages and commits are retarded. A commit should represent the state of your work as it is, not a piece of it. Why are you working on more than one thing at once? That's how bugs happen.
  • 1
    @lungdart yeah, can’t do irrelevant changes you’re not ready to push
  • 5
    Managing git files/stages/stashes etc via the cli just sucks, gui is superior

    I stage exactly the files or even individual lines I want with a single click
  • 2
    @devRancid rancid indeed

    cli ftw
  • 0
    Ok boomer 🤡
    U probably also prefer a fax machine over the internet
  • 2
    CLI = portable, unified and callable on remotes.
    Other devs look at me like I'm a git wizard but if they made the same one-time effort to experiment with and memorize the most useful commands and combine them in sequences they could do more advanced git ops faster and with confidence
  • 2
    @webketje Its possible to ssh into remotes with vscode just as easily, looks the same as locally (file tree etc) and you can still decide to use the terminal for some specific tasks
  • 1
    Always run git status.

    I've gotten fucked in the butt raw waaay too many times to learn this.
  • 2
    @SidTheITGuy Your head wasn't that smart to begin with
  • 5
    @devRancid "single click"? lmao, you guys use the MOUSE?!

    And now if you'll excuse me, I'll go memorize ten thousand fucking hotkeys that do absolutely nothing. Ta-ta!
  • 2
    "Git diff --cached|--staged" before you commit is quite handy especially if you just want to commit partial changes.
  • 4
    alias gpush='git add -A && git commit -am "Some changes" && git push'
  • 1
    I don't care. I always do git add . because it's faster
  • 2
    I usually do "git add .", but I also always (or most of the time) review the staged changes as well. If I've touched something that is not meant to go in, I undo/stash the changes (or at least unstage if it's a separate file).
  • 1
    Also: changes unrelated to PR and commit descriptions.
  • 0
    @SidTheITGuy yes, running git status beforehand has always been instinct for me
  • 0
    @devRancid yeah, I suppose it's easier to think it's easier to reason with the GUI in hairy situations where you're in doubt what to do, but with something like ChatGPT nowadays you can easily get the precise commands you need if you explain the situation clearly

    I prefer CLI but I can see how GUI can be helpful
  • 0
    @bosslogic shut up consultant
  • 0
  • 1
    @Liebranca you use the preset hotkeys! LMAO... be a dev and mod your env bro
  • 2
    @jestdotty phone line fax machines still exist and more businesses use them than youd realise... mostly smallish ones and stuff like non-chain real estate offices... but yeah.

    I only know this so well cuz when i had to move a bunch of sites i made over the past 2 decades and was technically still in charge of tech support for (which was pretty rare, mostly small businesses I made sites for when i was a teen), I made sure all their info was up to date when I told them about the relocate/new creds theyll likely never use. Sooo many phone line fax machines. A few changed to cable line phone service with the same number... but i was pretty surprised how many didnt.
  • 0
    @awesomeest I'm very much *drowning* in the perl scripts that generate my config files T_T
  • 1
    @Liebranca dude... if you even knew how much shit i control with scripts...

    Ive been scripting to reduce crap that annoys me since i was 7, at least.. im a month away from 32. My favourite OS is DOS and i script like CSS...

    I've also been setting up school and small business networks since i was 8 (my school needed me out of classrooms because i was asking questions that "confused other students who aren't at your level yet" then id end up somehow producing things to sell during class) ...i tries to use linux network manager... i really tried... then i tore it out of ever system and image we are running and went back to my simple scriots
  • 1
    @SidTheITGuy im technically a consultant... and way better than you at actual code.
  • 0
    @awesomeest why do you think you can jump in ?? you're literally not even in the conversation..

    the gall that bitches like you have is mind blowing
  • 1
    @awesomeest That'd make you roughly *two* human years older than me, but I will make the bold assumption that you too have -- in some occult capacity -- existed for several centuries, if not millennia.

    But websites? Networking? I'm not directly involved, and rather land on the far end of the metaprogramming zealotry side of the spectrum; we write code that writes code. It doesn't only *sound* like the xzibit meme, it __IS__ the xzibit meme.

    There is a wealth of arcane code generation utilities written through me by the sacred hand of Divine Providence. I don't know why God chooses programmers but there's already a precedent for this and the legends will continue to grow.

    Now, where was I? Ah yes, unemployment.
  • 1
    @SidTheITGuy You got rekt by awesomeest. Rip bruv.
  • 0
    @Liebranca frankly, i have no clue if youre serious or not... which is rare for me since im basically an organic, genius LLM (recursive linguistics expert and such paranormal pattern recognition that at first glance, any sane person should assume i may be a paranoid schizophrenic with delusions of grandeur... unfortunately the reality makes much less sense and is statistically improbable)

    I gonna look into u after i get my targetted work done.
  • 0
    @awesomeest You're welcome to browse through https://github.com/Liebranca/... for a full picture of my glorious insanity ;>
  • 0
    as always, it depends... but choose a side since its 2024 and all we have left is black and white
Add Comment