Error: The following files without a trace of the tree will be overwritten by merging: .gitignore

I am working on a web application with Angular JS. After Commit, I try to pull the latest version of another web developer to combine it with mine before I insert my latest changes. I get this error and don’t know why this is happening because I had no problems with the previous click / click.

error: The following untracked working tree files would be overwritten by merge: .gitignore Please move or remove them before you can merge. 
+6
source share
1 answer

It seems that you created a local .gitignore file, but did not send it to the repository, and the remote object you are trying to interact with (pull / push) now has .gitignore . This will be the case for any file in your repo when this happens.

Since .gitignore is not only a file, it affects the behavior of git, I would compare them manually, creating a file that is a union of the two, fixes it, and then combines it, fixes any formatting problems that may exist.

It may be the same file, but git will not know, because you have not added it locally. This is not a file that you want to change often, because it can do checks in different ways.

Github maintains a list of useful .gitignore templates for most languages.

+5
source

All Articles