Answer the question
In order to leave comments, you need to log in
How to remove a file from the index?
Good afternoon, please tell me what I'm doing wrong.
I have a prod, they rolled a git with the default master branch (git add . ; git commit -m 'init'), then cloned it to a test server, created a develop branch there and created a gitignor + added config files there. Then my actions: I apply rm to all gitignor files (I remove them from the index)
git rm --cached `git ls-files -i --exclude-from=.gitignore`
Answer the question
In order to leave comments, you need to log in
git filter-branch --force (so that the directory is not removed from the hard drive)
git filter-branch --tree-filter "rm -rf PATH" HEAD
where PATH is the path to the file/folder
How do I remove a directory in Git?
https://help.github.com/en/articles/removing-sensi...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question