I want to get the current head of my git repo destroying all changes made and erasing additional files in the working copy.
+1
A:
I think that you are looking for something like this. Be careful! This potentially erases things that you cannot get back.
git reset --hard
git clean -fx
Charles Bailey
2010-08-22 14:06:56
cool, that did the trick, go to make an alias for this.
Jan Limpens
2010-08-22 15:21:04
You can use -e on git-clean if theres a specific file you don't want to erase. If I recall, it can't be safely used with -x though (I believe it has no effect in that case). (This may only be in `master` of git.git though)
mathepic
2010-08-22 16:36:19
You might want to add the `-d` option to `git clean` - that'll make it remove whole untracked directories, which otherwise it'd ignore. You also might not always want to delete ignored files (`-x`).
Jefromi
2010-08-22 18:17:06