Cant pull nor commit from git for untracked file

432 views Asked by At

I was trying to pull from a repo and it gives me that message but if I run git status it says that my working tree has diverged and if I try to add and commit it gives me that error, (btw those files in the .gradle folder are in the .gitignore file so I don't get why there are being displayed when I try to use git)enter image description here

1

There are 1 answers

0
siride On

It means the branch you are merging into the current one has those files committed into Git somehow. Either someone else added them to the repository before they were in .gitignore or they forced them to be added despite .gitignore. Either way, you'll need to delete the local files (I'm assuming this is safe since they look like build artifacts), complete the pull, and then remove them from the repository directly with git rm -f for each file.