Firedrill: Recreate central git repository from developers clones

后端 未结 2 1783
日久生厌
日久生厌 2021-02-02 12:29

Say you have a scenario with a central master git repository, which developers and CI-engines clone from. I.e. very close to a traditional non-distributed version control syste

2条回答
  •  南笙
    南笙 (楼主)
    2021-02-02 13:07

    Just create an empty repository and, from the fully updated clone, do:

    git remote add new-origin url://to/new/origin
    
    git push --tags new-origin refs/remotes/origin/*:refs/heads/*
    

    Obviously, if the new origin is at the same url as the original one, you must be careful to not fetch from origin.

提交回复
热议问题