Re:Key Git Concepts Explained the Hard Way
by Already__Taken on Thursday March 15, 2018 @06:15AM
(#16591564)
git reset should be renamed to git remove, because add is used to add the staging. Or "git add" should be "git stage"
"git remove" should then be "git delete".
Re:Key Git Concepts Explained the Hard Way
by erik_seaberg on Thursday March 15, 2018 @11:23AM
(#16593613)
The staging area was a mistake because it's hidden in the repo where I can't build and test it. I should be stashing changes I don't want to commit, and then committing the known-good workspace.
"git revert" would have been clearer if it were identical but just named "git retract". It's a more natural match because reverting usually just means going back to how things were, whereas retracting can and often does mean to announce that you are going back. After a newspaper prints something untrue or unfounded, they issue a retraction.
"git checkout -b" is confusing because the main and most significant thing it does is create a new branch, and checking it out is secondary to that. If it had been "git branch -c" instead (create a branch also check it out) that would have been more natural than "git checkout -b" (check out a branch that, incidentally, you will have created).
"git reset", as you mentioned, does two things. This could have been made easier by just splitting it into two commands. Perhaps the first two forms could be called "git unstage". The git book ( https://git-scm.com/book/id/v2/Git-Basics-Undoing-Things ) explains it under a heading called "Unstaging a Staged File", which suggests that it's a more natural term.