How to remove origin from git repository

后端 未结 2 543
自闭症患者
自闭症患者 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
    
    0 讨论(0)
  • 2021-01-29 18:31

    Remove existing origin and add new origin to your project directory

    >$ git remote show origin
    
    >$ git remote rm origin
    
    >$ git add .
    
    >$ git commit -m "First commit"
    
    >$ git remote add origin Copied_origin_url
    
    >$ git remote show origin
    
    >$ git push origin master
    
    0 讨论(0)
提交回复
热议问题