Fork a project to an existing Repository. Is it possible? #67713
-
Select Topic AreaQuestion Feature AreaIssues BodyI am relatively new to github. The idea would be to create a "forked_repos" repository, and every time I fork one, being able to select that destiny Guidelines |
Beta Was this translation helpful? Give feedback.
Replies: 17 comments 4 replies
-
Short answerNo, I don't think so. Long-term, it's probably best to stick with 1 repository per "fork." Long answerYes, but it won't be easy. You can partially do it like so: # in forked_repos
git remote add repo-to-fork https://github.com/owner/repo-to-fork.git
git fetch repo-to-forkNow you have the history of git branch repo-to-fork/main my-contribution
git checkout my-contribution
git push -u origin my-contributionNow you've created a branch called However, once you've done that, AFAIK GitHub will not allow you to create pull requests, because GitHub doesn't know that you've "forked" the repository. GitHub will think that they're unrelated repositories. So you'll only be able to contribute if the maintainers take contributions other than pull requests, like emailing a patch. Alternative SolutionsSome users create organizations to put their forks, like https://github.com/cutlery-drawer. Personally, I just delete forks once my PR has been merged, unless I think I'll continue to contribute in the future. |
Beta Was this translation helpful? Give feedback.
-
|
of course you can |
Beta Was this translation helpful? Give feedback.
-
|
absoultly #2 |
Beta Was this translation helpful? Give feedback.
-
|
GitHub does not provide a direct built-in feature to fork a project into an existing repository. When you fork a repository on GitHub, it creates a new repository under your account. However, you can achieve a similar outcome by manually copying the contents of the forked repository into your existing repository. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
As an alternative, you can clone a repository as submodule (a Git repository as a subdirectory of another Git repository) by running I am not sure if this is the behavior you are looking for, please refer to the documentation for more details: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Hello GitHub Support Team, I am unable to login to my GitHub account @Jaikumar110. Problem:
Account details:
I am the original owner of this account. Please help me recover access or verify my identity so I can log back in. Thank you, |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.

Short answer
No, I don't think so. Long-term, it's probably best to stick with 1 repository per "fork."
Long answer
Yes, but it won't be easy.
You can partially do it like so:
# in forked_repos git remote add repo-to-fork https://github.com/owner/repo-to-fork.git git fetch repo-to-forkNow you have the history of
repo-to-forkavailable in your forks repo.Now you've created a branch called
my-contributionoff of therepo-to-fork'smainbranch, and set git up so that you push to themy-contributionbranch in your remoteforked_reposrepository.However, once you've done that, AFAIK …