我如何分叉一个公共存储库,但使我的分叉私有?我确实订阅了支持私有存储库。
当前回答
目前的答案有点过时了,所以,为了清楚起见:
简单的回答是:
做一个公共回购的纯克隆。 创建一个新的私有的。 做一个镜像推送到新的私有。
这在GitHub上有文档:复制一个存储库
其他回答
目前的答案有点过时了,所以,为了清楚起见:
简单的回答是:
做一个公共回购的纯克隆。 创建一个新的私有的。 做一个镜像推送到新的私有。
这在GitHub上有文档:复制一个存储库
你必须复制一份回购
你可以看到这个文档(来自github)
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. In the following cases, the repository you're trying to push to--like exampleuser/new-repository or exampleuser/mirrored--should already exist on GitHub. See "Creating a new repository" 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 repository $ cd old-repository.git $ git push --mirror https://github.com/exampleuser/new-repository.git # Mirror-push to the new repository $ cd .. $ 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 repository $ cd repository-to-mirror.git $ git 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 origin $ git push --mirror
https://help.github.com/articles/duplicating-a-repository
现在多了一个选择(2015年1月)
创建一个新的私有回购 在空的回购屏幕上有一个“导入”选项/按钮 点击它,并把现有的github回购url 没有github选项提到,但它与github回购工作太。 完成
GitHub现在有一个导入选项,可以让你选择任何你想要的新导入的公共或私有存储库
去https://github.com/new/import吧。
在“您的旧存储库的克隆URL”部分粘贴您想要的回购URL,并在“隐私”中选择“私有”。
推荐文章
- 为什么我需要显式地推一个新分支?
- 如何撤消最后的git添加?
- Rubymine:如何让Git忽略Rubymine创建的.idea文件
- Gitignore二进制文件,没有扩展名
- Git隐藏错误:Git隐藏弹出并最终与合并冲突
- 了解Git和GitHub的基础知识
- 没有。Git目录的Git克隆
- 在GitHub上有一个公共回购的私人分支?
- Git与Mercurial仓库的互操作性
- 忽略git中修改(但未提交)的文件?
- 只用GitHub动作在特定分支上运行作业
- “git restore”命令是什么?“git restore”和“git reset”之间有什么区别?
- Git合并与强制覆盖
- Git拉另一个分支
- 是否有一个链接到GitHub下载文件的最新版本的存储库?