When 'git pull' won't work

Git makes me happy in controlling the versions of a project's code base & allowing you to recover from wandering off in wrong directions.

But when you want to throw away some ill-considered changes to your code on your development machine, git can obstinately refuse to 'pull' from your repo. Try to do a git pull & you'll get an 'error: Your local changes to the following files would be overwritten by merge: ...' If you want to throw away your local changes and re-sync with the repo (yes, you'll lose any commits since your most recent push), you can do this:-

#> git fetch --all

#> git reset --hard origin/master

#> git pull origin master

This will destroy your mistakes & grab an up-to-date copy from the repo.