Remove deleted files from git history

后端 未结 2 1912
礼貌的吻别
礼貌的吻别 2020-12-04 19:26

I\'m trying to split a subproject off of my git repository. However unlike in Detach (move) subdirectory into separate Git repository I don\'t have it in it\'s own subdirect

2条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 20:20

    Here are some instructions to do what you want.

    This will remove file_to_remove:

    git filter-branch --index-filter 'git rm --cached --ignore-unmatch file_to_remove' --prune-empty -- --all
    

提交回复
热议问题