Proper way to remove unwanted files with git filter-branch without git rm failing

前端 未结 4 1137
迷失自我
迷失自我 2020-12-10 18:58

I have a project of an SNMP agent where the related MIB files (*.smiv2 files) were developed along with it, but now I want them in a separate git repository.

In orde

4条回答
  •  误落风尘
    2020-12-10 19:19

    Full Answer, for future reference

    git filter-branch --prune-empty --index-filter 'git ls-files | \
    grep -v ".smiv2$" | xargs git rm --cached --ignore-unmatch DoesNotExistInMyProject'
    

提交回复
热议问题