Once in a while when I do git pull I start getting this error: error: Untracked working tree file [some file] would be overwritten by merge.
I normally want to overwrite the local changes so I do this:
git reset --hard HEAD
git clean -f -d
git pull
This was instructed here: How do I force "git pull" to overwrite local files?
However, this method seems to erase all the untracked files. So is there a way to force git to overwrite local channges but to keep all the untracked files?