Git: How to remove files that are now in gitignore but were added to repo before

纵饮孤独 提交于 2019-12-01 19:27:35

You need git filter-branch first, then ask everybody to rebase branches created off of your old history.

Refer to: https://help.github.com/articles/remove-sensitive-data/

This is complex, and might cause issue, so next time be careful so not to get there.

If you can't do that due to some reason, then need to wait until time machine invented :)

AFAIK, there is no way to mark a filepath with a "stop tracking this but keep existing version" flag.

You will need to take one manual action when deploying the first version that includes deleting the file.

Something like :

cp file file.prod
git pull
mv file.prod file
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!