How do you fork your own github project?

I have a public repo on Github. I want to replicate / copy it and work on a new project based on the current repo. But I do not want to influence the current repo. I tried to launch it using the GitHub web interface, but did nothing.

I appreciate your help.

+132
git version-control github git-fork
Jun 09 '12 at 19:22
source share
10 answers

I don’t think you can unlock your own repo.
Cloning it and clicking on a new repo is good, but you need to:

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 

(see git push )

See the whole process described in the section Create your own project on GitHub .




Six years later (2016) you now have a GitHub importer that allows you to import repos from another source ... including GitHub.
See " Importing a repository with a GitHub importer "

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

narf answer (upvoted) also illustrates this process.

This will allow you to create a new repository and import the full history of the old into the new one using its GitHub URL.

Again: what you get is a copy, not a real fork: you cannot make a pull request from a new repo to an old one.

+165
Jun 10 '12 at 6:27
source share

The easiest way to do this in 30 seconds from the GitHub website:

  • Copy repo url. Example: https://github.com/YourName/YourOldRepo (hint: this is the URL when you look at the repo main page on github.
  • Click the + icon in the upper right corner.
    /img/53e8548b3fe2542e19f5664b0ae9f986.png
  • Select Import Repository.
  • Where it asks for the "Old URL", paste the URL that you copied in step # 1
    /img/f93c91add276e861b57717b87abdbd71.png
  • Enter the name of the new repo and click Begin Import .
  • What is it! Now you have a copy of the complete repo with all the stories and commit branches!

Limitations: This is not a real plug. This is a copy of the repo. This will not allow you to make requests for round-trip requests.

+87
Apr 23 '17 at 21:03 on
source share
+7
Jul 19 '15 at 12:47
source share

Just clone it, create a new empty repo and click on it.

+4
Jun 09 '12 at 19:37
source share

The easiest way to achieve the desired effect is to create a new repository, then select the import option and specify the URL of the repo you want to use.

The images below will help:

Create your own repo via import-1

Fork own repo through import-2

+3
Nov 30 '16 at 17:41
source share

I followed these official instructions for Duplicating the Repository and seemed to work.

https://help.github.com/articles/duplicating-a-repository/

To duplicate the repository without overlapping, you need to run the special clone command against the original repository and mirror click on the new one. This works with any git repository, not just hosted on GitHub.

+1
Nov 10 '14 at 8:53
source share

The decision made by VonC, unfortunately, did not work for me, since I got

remote: repository not found

What was the job:

  • Create new_repo on github
  • git clone new_repo
  • cd new_repo
  • git remote add upstream old_repo.git
  • git pull upstream master
  • git push origin master

I got all of the above from here .

+1
Jul 24 '15 at 21:48
source share

For non-technical approaches using GitHub, here is one simple solution as an alternative to the other great answers above. You only need the GitHub Desktop app.

  • Open your own project repo from a browser and download it as a zip, for example your-project-master.zip .
  • Unzip and rename it as a new repo.
  • Open the GitHub desktop and add a new repo by viewing it on your new open disk repository. enter image description here
  • Post it on your github by clicking the publish button. Do not forget to add a name and description :)
+1
Dec 28 '16 at 3:48
source share

Just tried this and it worked:

  • Add your repo to your organization account
  • Rename it
  • Transfer ownership to yourself
-one
Feb 09 '14 at 17:15
source share

When creating a new repo, you can import from another repo with the .git url repo. It took me 30 seconds.

-one
Apr 7 '17 at 12:41 on
source share



All Articles