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?
If you are going to add these untracked files to your working tree, then you can add them to the working tree. When you want to pull changes from origin you can
stashthem away and do a pull. After the pull you can pop your stash.