The following untracked working tree files would be overwritten by merge, but I don't care
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 those files are no longer ignored or not.
Unfortunately, I get error: the following untracked working tree files would be overwritten by merge as shown below:
The following untracked working tree files would be overwritten by merge
How would I modify my pull command to overwrite those files, without moving or deleting those files myself?
The reason of getting this error:” the following untracked working tree files would be overwritten by merge” is that you’re not tracking the files locally but there might be a chance that the identical files are tracked by the remote.
So the pull is forcing your system to overwrite the files which are not version controlled. For this you can use:
git add *
git stash
git pull
These commands will track all the files and remove all changes in files on your local system. And get the files from the server.