git - 你如何在 GitHub 上创建自己的仓库?

标签 git github version-control git-fork

我在 GitHub 上有一个公共(public)存储库。我想复制/复制它并基于这个存储库处理一个新项目,但我不想影响它现在的样子。我尝试使用 GitHub UI 对其进行 fork ,但它没有执行任何操作。

最佳答案

我不认为你可以 fork 你自己的代码库。
克隆它并将其推送到新的 repo 很好,但你需要:

git clone https://github.com/userName/Repo New_Repo
cd New_Repo
git remote set-url origin https://github.com/userName/New_Repo
git remote add upstream https://github.com/userName/Repo
git push origin master
git push --all

(参见 git push)

请参阅“Fork your own project on GitHub”中描述的所有过程。


六年后(2016 年),您现在拥有 GitHub importer它允许您从其他来源导入存储库...包括 GitHub。
参见“Importing a repository with GitHub Importer

https://help.github.com/assets/images/help/importer/import-repository.png

narfanswer (赞成)也说明了这个过程。

这将允许您创建一个新的存储库,并使用其 GitHub url 将旧存储库的完整历史导入新存储库。

再说一次:您得到的是一个副本,而不是真正的 fork :您不能从新仓库向旧仓库发出 pull 请求。

再次(之二),如所述in the comments通过 mpersico ,这不是一个真正的 fork 。

If I have a foo which is the canonical source repo for an open source project that I want other people to fork and have access to do PR, then I do not want to work in that repo, I want a fork I can use to issue proper PRs against my project.
I have solved this my creating a second account in GitHub and forking to that.

关于git - 你如何在 GitHub 上创建自己的仓库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10963878/

相关文章:

git - 使用 "git format-patch origin/master --stdout"创建的空补丁

git - 如何将 pull 请求从我的 fork 发送到另一个 fork ?

node.js - n( Node 版本管理器)安装后不工作 - "bash: n: command not found"

git - 在这种情况下如何使用 Git 处理共享代码?

git - 暂存删除的文件

java - 如何在WebApp中像Diff一样构建SVN/Git?

git - 如何在 Visual Studio 2015 中创建新分支?

git - git push上更改用户名Github "You must verify your email address"403错误

git - 如何更新 Github 克隆的存储库?

version-control - 如何以p4用户身份登录