How to make git repo remember all remotes?

前端 未结 3 2062
忘了有多久
忘了有多久 2020-12-29 07:40

I have a git repo that is a fork of another repo. As a rule I will normally add a remote called upstream, which is the original repo I forked from.

$ git rem         


        
3条回答
  •  情话喂你
    2020-12-29 08:27

    That is impossible. Git only clones the repo’s content, never its settings. If your want to hard-wire remotes into your repo (it stands to question whether that is a good idea), create a script repo-setup.sh in your repo root that does something like this:

    git remote rm origin
    git remote rm upstream
    git remote add origin git@github.com:skela/awesomeproject.git
    git remote add upstream git://github.com/bob/awesomeproject.git
    

    Then run this file after you cloned the repository.

提交回复
热议问题