News for hackers. Stuff that matters.
Re:Learn Enough Git to Be Dangerous by hvis on Saturday February 06, 2016 @06:42AM (#11047342)
You missed the point of the '--hard' argument. It destroys the local, uncommitted changes.

That can be much scarier than 'git push -f'.

Re:Learn Enough Git to Be Dangerous by slavik81 on Saturday February 06, 2016 @03:38PM (#11049719)
Apparently we both need to write better, because you missed the point of my example. Most—if not all—local changes that would be destroyed by git reset --hard show up in git status.

git clean -dfx will wipe out ignored files, which do not show up in git status, so it's much easier to forget about something you meant to keep.

Re:Learn Enough Git to Be Dangerous by hvis on Monday February 08, 2016 @06:31AM (#11057548)
I've never used 'git clean -dfx' routinely during development. On the other hand, I've seen a colleague lose a few hours' work by forgetting to commit a specific file out of a set, and then doing 'git reset --hard' for some reason. 'git status' didn't save him. Luckily, he did commit the corresponding tests file.