Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you fork a repo whose upstream you've already forked?

Tags:

github

bitcoin

I want to fork namecoin/namecoin, but I've already forked bitcoin/bitcoin. The latter is the upstream parent of the former. The forkchain is:

bitcoin/bitcoin -> vinced/namecoin -> namecoin/namecoin

When I fork namecoin/namecoin, Github just redirects me to my myuserid/bitcoin fork, instead of creating a new myuserid/namecoin fork. It appears to Github that they are the same project, but they are not.

Anyone know how to do this?

like image 739
Kurtosis Avatar asked Nov 28 '11 01:11

Kurtosis


People also ask

Can I fork a forked repo?

You can fork any repo by clicking the fork button in the upper right hand corner of a repo page. Click on the Fork button to fork any repo on github.com. Source: GitHub Guides.

Can you fork a repo twice?

You are unable to fork a repo twice on Github (as of late 2021) but if you want to build on the same repo multiple times, you can use the "Import Repository" option and feed it the URL used to clone.

How do you pull changes from upstream to fork?

Go to your fork, click on Fetch upstream , and then click on Fetch and merge to directly sync your fork with its parent repo. You may also click on the Compare button to compare the changes before merging.


1 Answers

You can't do this "officially", but you can always add another remote for bitcoin and fetch from that.

git remote add bitcoin-orig git://the/bitcoin/repo/path

git fetch bitcoin-orig

# Merge into your 'master' (CAUTION: This might go badly)
git merge bitcoin-orig/master  

# Create a local branch based on the origin
git co -b bitcoin-orig-master bitcoin-orig/master  

# Take an individual commit from the original repo and put it into your 'master'
git log bitcoin-orig/master && git cherry-pick <SOME SHA>  
like image 111
Ana Betts Avatar answered Sep 19 '22 12:09

Ana Betts