I accidentally added all files from my local folder into my git repository. I want to untrack some of files ending with certain symbol, like "~" etc. How can I do this? Since I already added them into the repository, any edit in .gitignore will not untrack already added files.
Asked
Active
Viewed 76 times
1 Answers
2
This is not exactly the same question, so I won't mark as duplicate, but the second answer here should apply.
Quoted answer:
The series of commands below will remove all of the items from the Git Index (not from the working directory or local repo), and then updates the Git Index, while respecting git ignores. PS. Index = Cache
First:
git rm -r --cached .
git add .
Then:
git commit -am "Remove ignored files"