我犯了一個大文件的刪除。現在我想從我的本地.git
中取出這個大文件。任何可以遵循的步驟都可行?如何從提交歷史中完全刪除文件?
我想:
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch$files" HEAD
這
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch $file' --prune-empty --tag-name-filter cat -- --all
命令'GIT中濾波器分支--force --index濾波器 'git的RM --cached - 忽略UNMATCH $ Rake文件' --prune-空--tag-name-filter cat - --all'適用於我。處於repo-root目錄和$ Rakefile中,包括要刪除的文件的相對路徑。 'linux,git version 2.6.4'。 – dr0i