Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The very first factual claim in the article is wrong:

"The most basic usage is: git reset useful_func.clj This will replace the useful_func.clj in the current working directory with the last committed version in the repository HEAD."

Not a good start. What it actually does is reset the path "useful_func.clj" in the index (AKA staging area) to the HEAD state. It doesn't touch the working directory.



It's not clear to me if the author actually understands how staging works and how that affects the commands they suggest. They claim that stashing takes staged changes and then note that after stashing the working tree will be clean. That suggests the post is being dumbed down or the author is misunderstanding things.

Git guidance should almost always start with a brief introduction to the concepts you believe the audience doesn't know or fully understand. To begin with reset and not properly explain the index will just end up being confusing, especially with brief references to hard, soft and mixed resets later on!


I see this so often with power user tools. All power user tools are tools that you can only use reasonably well with some basic understanding. They are made not to be understood in the easiest fashion but to handle all complexities of a problemset as efficiently as possible. Therefore it sometimes seems harder to use from the outside, but actually the hardness comes from the problem it solves, not the tool.

So yeah, if you really want to use git well, learn its internals. It takes some time but actually not even hard. After reading the Git Book once I was even able to implement my own git (of course without performance considerations).


One would idiomatically use “git checkout <path-to-file>” for the functionality described by the author: “get some file back to the latest version committed in HEAD”.

Stopped reading after I saw this.


Same. Came here looking for a comment that would point this out and I was not disappointed.

Trying to learn something from a bad article is worse than reading no article at all.


Thanks for confirming, they made me doubt for a second.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: