On my branch I had some files in .gitignore
On a different branch those files are not.
I want to merge the different branch into mine, and I don\'t care if t
Remove all untracked files:
git clean -d -fx .
Caution: this will delete IDE files and any useful files as long as you donot track the files. Use this command with care
You can try that command
git clean -df
If you have the files written under .gitignore, remove the files and run git pull again. That helped me out.
One way to do this is by stashing you local changes and pulling from the remote repo. In this way, you will not lose your local files as the files will go to the stash.
git add -A
git stash
git pull
You can check your local stashed files using this command - git stash list
If this is a one-time operation, you could just remove all untracked files from the working directory before doing the pull. Read How to remove local (untracked) files from the current Git working tree? for information on how to remove all untracked files.
Be sure to not accidentally remove untracked file that you still need ;)
Neither clean/reset/hard checkout/rebase worked for me.
So I just removed files that git complained about*
rm /path/to/files/that/git/complained/about
*I checked if this files can be removed by checking out a brand new repo in a separate folder (files were not there)