Remix.run Logo
jameshart 5 hours ago

git add . is nondestructive and reversible. I tend to do git add . and then run git status.

I’m far more interested in confirming my mental model of what I am about to commit if I git commit right now than my mental model of what will be added if I git add right now.

If I didn’t already have that muscle memory I might try to switch to git add -v . which would tell me what files it added. I’d argue that a sane git would just output git status after a git add operation.

But also a sane git would have a more logical command than git rm —cached to unstage a file. Like git unstage perhaps.

mrgitmfmfm an hour ago | parent [-]

No, ”git add .” is not easily reverted, there’s no git sub command for de-adding files from the staging area. You have to copy the whole folder (hope you have enough disk space), checking out an older commit (hard), and copy specific files from the copied folder. Pita.

This is actually a general problem with git and most cli tools, where it would be possible and useful to undo an action, but the tool developer cannot be bothered to implement such time-saving feature.

YoureWrong23 an hour ago | parent [-]

    git reset