it seems there are already "simlilar" answers, but my situation is
- I'm working on a public branch with many teammates
- file "a.txt" was commited and pushed
- I add "a.txt" in
.gitignore
- I run
git rm --cached a.txt
- and "a.txt" does been ignored in my local branch, then I push it
- but seems my teammates keep pushing this file back, everytime I pull from remote, "a.txt" is not ignored
so should I ask all my teammates to run git rm --cached a.txt
in their local branch?
(a.txt is the classic "package-lock.json", due to diff versions among local machines and servers)
CodePudding user response:
I think they are adding a.txt
back. If you also add .gitignore
and push, then they probably won't add it again.
Note: package-lock.json
is intended to be included in source control. See: here
CodePudding user response:
In the first place, why this file [package-lock.json] should be ignored? Is it unnecessary for the project? If so, then the team members should be informed of that.