Creating Twin Repositories
How to create a twins repository that includes both branch and tag. 🙍🙍
Test environment
- git v2.17.1
Grammar
$ git clone --mirror <org_repository>
$ cd org_repository
$ git remote -v
$ git remote set-url --push origin <new_repository>
$ git remote -v
$ git push --mirror <new_repository>
Demo
- org_repository : https://github.com/sarojaba/awesome-devblog.git
- new_repository : https://github.com/leechungkyu/new-awesome-devblog.git
$ git clone https://github.com/sarojaba/awesome-devblog.git
Cloning into 'awesome-devblog'...
remote: Enumerating objects: 136, done.
remote: Counting objects: 100% (136/136), done.
remote: Compressing objects: 100% (88/88), done.
remote: Total 7219 (delta 81), reused 87 (delta 48), pack-reused 7083
Receiving objects: 100% (7219/7219), 2.59 MiB | 2.28 MiB/s, done.
Resolving deltas: 100% (4595/4595), done.
$ cd awesome-devblog
$ git remote -v
origin https://github.com/sarojaba/awesome-devblog.git (fetch)
origin https://github.com/sarojaba/awesome-devblog.git (push)
https://github.com/leechungkyu/new-awesome-devblog.git
✅ The repository must be created in advance.
$ git remote set-url --push origin https://github.com/leechungkyu/new-awesome-devblog.git
$ git remote -v
origin https://github.com/sarojaba/awesome-devblog.git (fetch)
origin https://github.com/leechungkyu/new-awesome-devblog.git (push)
$ git push --mirror https://github.com/leechungkyu/new-awesome-devblog.git
Delta compression using up to 2 threads.
Compressing objects: 100% (2586/2586), done.
Writing objects: 100% (7219/7219), 2.59 MiB | 1.52 MiB/s, done.
Total 7219 (delta 4595), reused 7219 (delta 4595)
remote: Resolving deltas: 100% (4595/4595), done.
To https://github.com/leechungkyu/new-awesome-devblog.git
* [new branch] master -> master
* [new branch] origin/HEAD -> origin/HEAD
* [new branch] origin/gh-pages -> origin/gh-pages
* [new branch] origin/master -> origin/master
👥 Result
Author And Source
この問題について(Creating Twin Repositories), 我々は、より多くの情報をここで見つけました https://qiita.com/leechungkyu/items/d2087d3cc85bc2b86a03著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .