Force a guaranteed git pull success story

Thursday, Nov 29th, 2012

Sometimes you need to script a git pull or you just want to completely reset a repo to HEAD. You there are loads of errors git can throw you in the process; such as error: unable to unlink old 'sites/default/settings.php' or error: The following untracked working tree files would be overwritten by checkout. Below is my take on the complete repository reset/clean/pull. Let me know in the comments if you've got a better way or find errors I'm missing.