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)
Asked
Active
Viewed 357 times
-1

Maik Lowrey
- 15,957
- 6
- 40
- 79

Jonatan Sciaky
- 41
- 5
-
4I suggest you read the output. It tells you exactly what the problem is and what to do about it. – Code-Apprentice Dec 27 '21 at 21:19
-
@Code-Apprentice It's a little more complicated since the files are in the `.gitignore` file. The files do need to be deleted, but that won't fix the long-term problem. – siride Dec 27 '21 at 21:39
1 Answers
2
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.

siride
- 200,666
- 4
- 41
- 62