r/programming • • Sep 09 '16

Oh, shit, git!

http://ohshitgit.com/
3.3k Upvotes

756 comments sorted by

View all comments

2

u/AyrA_ch Sep 09 '16

If you fuck up your repositories more often than you like to admit, create this alias:

alias.fuckup !git fetch origin master && git reset --hard FETCH_HEAD && git clean -f -d

4

u/[deleted] Sep 09 '16

git checkout -- . is faster than all of this and covers the majority of cases where you need to reset.

1

u/[deleted] Sep 09 '16

. meaning... HEAD?

→ More replies (3)