News for hackers. Stuff that matters.
Re:Git Commands You Probably Do Not Need by ilyt on Monday January 23, 2023 @07:02AM (#34487843)
no git stash ?
Re:Git Commands You Probably Do Not Need by forgotpwd16 on Monday January 23, 2023 @07:41AM (#34488122)
* * *
Re:Git Commands You Probably Do Not Need by ilyt on Monday January 23, 2023 @05:58PM (#34496315)
I mean I can configure my shell correctly so that isn't a problem in the first place

    -> ᛯ date >> asd     
    [23:57:10] ^ [/tmp/a] {master *}
    -> ᛯ git stash       
    Saved working directory and index state WIP on master: bf5a0f8 fix
    [23:57:13] ^ [/tmp/a] {master $}
    -> ᛯ git pop         
    On branch master
    Changes not staged for commit:
      (use "git add <file>..." to update what will be committed)
      (use "git restore <file>..." to discard changes in working directory)
     modified:   asd
    
    no changes added to commit (use "git add" and/or "git commit -a")
    Dropped refs/stash@{0} (4f46bc00a3d6032c2726f04540a44656090e05ca)
    [23:57:16] ^ [/tmp/a] {master *}
    -> ᛯ 
it's pretty non-missable (git pop is just alias to stash pop)
Re:Git Commands You Probably Do Not Need by RichardCA on Monday January 23, 2023 @05:13PM (#34495863)
If your work-in-progress files are trivial, it's easy to create a temp directory with a .gitignore with just a '*' in it and leave your files there.

If it's not so trivial, create a local temp branch so you can cherry-pick it or merge it back in later, or maybe convert your temp branch into a more enduring one.

Stashes are pseudo-commits with no branch context, and are more of a conceptual burden then they're worth.

Re:Git Commands You Probably Do Not Need by ilyt on Monday January 23, 2023 @06:06PM (#34496395)
or just type git stash

do whatever you need

git stash pop

done

> Stashes are pseudo-commits with no branch context, and are more of a conceptual burden then they're worth.

They are literally just commits like everything else. They just land in refs/stash, where branches/tags live.

Man the shit people say about how git works while not knowing how git works...

It's essentially a temporary branch with some syntactic sugar to manage

You can even just convert it to normal branch

    git branch cake stash@{0}
Re:Git Commands You Probably Do Not Need by RichardCA on Monday January 23, 2023 @06:36PM (#34496719)
Dude, have you ever tried the .gitignore trick? It really does come in handy.

And your overall tone was uncalled-for. Cheers.