1

I have the following scenario:

.../orig-user/repo   # the original repo
.../user2/repo       # a fork of above
.../user3/repo       # a fork of .../user2/repo

is there any convenient way to "re-home" .../user3/repo so it becomes a 'direct' fork of .../orig-user/repo?

Alternatively, is there a simple way for user3 to stay updated without involving user2?

thebjorn
  • 26,297
  • 11
  • 96
  • 138
  • Possible duplicate of : https://stackoverflow.com/questions/28672714/manually-set-forked-from-to-github-project – LeGEC Dec 01 '16 at 15:50

2 Answers2

2

You can change/add remote (say, upstream) that will indicate /orig-user/repo.

If your upstream already exists, then change that url with /orig-user/repo.

$ git remote -v      # see all the remotes
$ git remote set-url upstream <url-of-orig-user-repo>      # change the upstream url

Or, add a new upstream one.

$ git remote add <upstream> <url-of-orig-user-repo>    # Add new remote/repositories 

Now when need to take the changes of /orig-user/repo repo just pull from upstream

$ git pull upstream master         # here, upstream is the remote of /orig-user/repo 
Sajib Khan
  • 22,878
  • 9
  • 63
  • 73
  • Am I correct in assuming that this will not change the "forked from.." in github (pull-requests from a fork-of-a-fork seem to be more challenging). – thebjorn Dec 01 '16 at 15:39
  • You're right. This will not change `forked from..`. So, in that situation you can re-fork a new repo from original and take your `user3` changes into it. – Sajib Khan Dec 01 '16 at 15:44
1

If you just want to allow user3 to push/pull from original repo :

How do I change which GitHub project I forked from?

If you want to also change the "forked from ..." message in the repo :

Manually set 'forked from' to GitHub project

LeGEC
  • 46,477
  • 5
  • 57
  • 104
  • I want to change the "forked from..". The answer in that link says I have to fork `.../orig-user/repo` into a new `..user3/repo2` and then push `.../user3/repo` onto the new `.../user3/repo2` before abandoning `.../user3/repo` and starting to use the new `.../user3/repo2`. Did I understand that correctly? Will the method suggested by @sajibkhan not work? – thebjorn Dec 01 '16 at 15:31