Reputation: 71
I have removed my file using git rm --cached and git reset HEAD. But when I try to push it to my repo, it still adds that file? How can I completely remove that file?
Upvotes: 2
Views: 2499
Reputation: 6384
For anyone seeing this question in the future,
Remember you must remove the files and then commit with the .gitignore
present for the .gitignore
to actually ignore the files.
Not deleting the files manually will result in the existing files staying in the repo, but new files that are added will be ignored.
Upvotes: 2
Reputation: 1355
git rm <filename> will keep track of your file that you are deleting a file which is there in git repo and keeps track yes the behavior is right.
for you, you need to remove it normally rm -rf will delete the file now . now do git status
and don't add the deleted file then commit
and push it . it will work as how you are expecting.
Upvotes: 0