Duplicating a repository
来源:互联网 发布:http协议获取mac地址 编辑:程序博客网 时间:2024/05/29 14:28
Repositories / Duplicating a repository
Article last updated on 20-Mar-14Duplicating a repository
To create a duplicate of a repository without forking, you need to run a special clone command against the original repository and mirror-push to the new one. This works with any git repository, not just ones hosted on GitHub.
In the following cases, the repository you're trying to push to--like exampleuser/new-repository
orexampleuser/mirrored
--should already exist on GitHub. Visit the Creating a new repository guide for more information.
Mirroring a repository
To make an exact duplicate, you need to perform both a bare-clone and a mirror-push.
Open up the command line, and type these commands:
git clone --bare https://github.com/exampleuser/old-repository.git# Make a bare clone of the repositorycd old-repository.gitgit push --mirror https://github.com/exampleuser/new-repository.git# Mirror-push to the new repositorycd ..rm -rf old-repository.git# Remove our temporary local repository
If you want to mirror a repository in another location, including getting updates from the original, you can clone a mirror and periodically push the changes.
git clone --mirror https://github.com/exampleuser/repository-to-mirror.git# Make a bare mirrored clone of the repositorycd repository-to-mirror.gitgit remote set-url --push origin https://github.com/exampleuser/mirrored# Set the push location to your mirror
As with a bare clone, a mirrored clone includes all remote branches and tags, but all local references will be overwritten each time you fetch, so it will always be the same as the original repository. Setting the URL for pushes simplifies pushing to your mirror. To update your mirror, fetch updates and push, which could be automated by running a cron job.
git fetch -p origingit push --mirror
- Duplicating a repository
- Duplicating a Database
- Duplicating a controlfile into ASM when original controlfile is stored on ASM
- Create a Shared Repository
- create a github repository
- github remove a repository
- Setting Up a Maven Repository
- Ubuntu:Adding a software repository
- Git Create a new repository
- Creating a Shared Repository; Users Sharing The Repository
- Duplicating managed version 版本冲突
- maven 出现Duplicating managed version
- Using a JPA based idempotent repository
- Setting up a new remote git repository
- Backing Up & Restoring a Remote SVN Repository
- How to Host a Cydia™ Repository
- Create a Repository in Navigator environment
- Git: Setup a remote Git repository
- V学-L-A习-N
- freemarker 判断字符串长度大于几
- js 将json字符串转换为json兑现
- JSP技术生成动态页面内容的过程
- 《UNIX系统编程》
- Duplicating a repository
- JS - String方法详解
- 正确计算文本所占字节数
- android apk 导出(签名) is not translated in xx 代码混淆 反编译
- HDU1827Summer Holiday (强连通,缩点,最小费用)
- 初识JRuby之入门
- 使用RunWith注解改变JUnit的默认执行类,并实现自已的Listener
- 你猜这个js是干嘛的?
- 使用Eclipse NDK-build 编译jni的步骤示例