Note: You may also want to run
git -f clean
as
git reset --hard
will not remove untracked files, where as git-clean will remove any files from the tracked root directory that are not under git tracking. WARNING - BE CAREFUL WITH THIS! It is helpful to run a dry-run with git-clean first, to see what it will delete.
This is also especially useful when you get the error message
~"performing this command will cause an un-tracked file to be overwritten"
Which can occur when doing several things, one being updating a working copy when you and your friend have both added a new file of the same name, but he's committed it into source control first, and you don't care about deleting your untracked copy.
In this situation, doing a dry run will also help show you a list of files that would be overwritten.