How to remove origin from git repository

后端 未结 2 596
自闭症患者
自闭症患者 2021-01-29 17:45

Basic question: How do I disassociate a git repo from the origin from which it was cloned?

git branch -a shows:

* master
  remotes/origin/HE         


        
2条回答
  •  南笙
    南笙 (楼主)
    2021-01-29 18:18

    Fairly straightforward:

    git remote rm origin
    

    As for the filter-branch question - just add --prune-empty to your filter branch command and it'll remove any revision that doesn't actually contain any changes in your resulting repo:

    git filter-branch --prune-empty --subdirectory-filter path/to/subtree HEAD
    

提交回复
热议问题