How to remove origin from git repository

后端 未结 2 542
自闭症患者
自闭症患者 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: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
    

提交回复
热议问题