How I created a second fork of a Github repo

Tried following the steps mentioned in http://alt.adrianshort.co.uk/blog/2011/11/08/create-multiple-forks-of-a-github-repo/ but it didn’t work for me for some reason. Documenting this for personal purposes.

Was working on a new machine, so had to:

Set up Git

git config –global user.name “Username”
git config –global user.email “youremail@yourdomain”
git config –global credential.helper cache
git remote add origin https://github.com/Username/YourRepo.git

Generate SSH Keys 

cd ~/.ssh
ssh-keygen -t rsa -C “youremail@yourdomain”

Clone the original Github Repo  on local machine, rename the origin branch as stated here
git clone https://github.com/SourceUserName/SourceRepo.git
cd SourceRepo/
git remote rename origin upstream

Created a new empty repo on the Github account

Push code from local machine to Github

The following didn’t work for me – git requested username/password. I gave it the correct values but it threw an authentication error –> git push -u origin master

So:

git push git@github.com:Username/YourRepo.git master –force

Edit: The only downsides to this are:

1. the second fork is not identified as a fork of the original repository, and
2. you cannot name the second repository with the same name on Github. This could be  a problem if your CMAKE compile files rely on a specific repository name.

 

Advertisements

About Alexis Chan

https://alexisylchan.wordpress.com/about/
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s