Reputation: 245
I am using a git bitbucket repository with 3 other developers.
One of the devs accidentally pushed a file that we don't want tracked in the repo, and now I am trying to delete it.
When I do the command:
git update-index --assume-unchanged nbproject/genfiles.properties
it gives me the error:
fatal: Unable to mark file nbproject/genfiles.properties
although the file is clearly there. I have committed. However, I when I do a git status I have two changes that are not staged for commit (because I purposefully exclude them from committing).
We are all using Netbeans (no choice) and it is the project-specific files I am trying delete as we are different on different machines (they are on Mac, I'm on Linux).
Is it possible for me to delete or untrack this file that was added by someone else? I am the admin on the bitbucket repo.
The file is in my .gitignore.
Upvotes: 1
Views: 1928
Reputation: 245
I found the answer to my problem. I did a git ls-files
and saw that the files I wanted rid of were not being tracked by me. This is why I could not mark or remove them.
So I got hold of my colleagues and had them run the same command to find out who was tracking the files. When I found the culprit I had them run git rm --cached filename
, then commit, then push.
Problem solved.
Upvotes: 3