I have a question about git:
I forgot to add .gitignore before committing, and committed some binary files in the format of .db
or .pyc
. And to make matters worse, I committed several versions without paying attention. Now how do I commit it? Are these binaries being removed in batches from all versions and will they be stopped from being tracked in the future? Thank you!
高洛峰2017-05-02 09:35:23
Use git rm file to delete the tracking of the file, and it will be deleted locally.
Use git rm file --cached file to delete the tracking of the file, but it will be retained locally.
Remember to add modification .gitignore and then push it
曾经蜡笔没有小新2017-05-02 09:35:23
Please ensure safety before starting the command:
git rm --cached [文件名]