How can I combine my separate repo as if it started as a fork?

I have two github repositories, both of which I am an admin:

Both were created using git-svn from ... the svn repository, of course. Now I would like to combine the two repositories into one sequential view (please excuse me if my terminology is not accurate). I would like to have one repo (https://github.com/sghael/OSQA) with several branches:

  • master - it automatically syncs with svn and does not receive any built-in git commits. (We already have this automatic synchronization using the cron job that git svn rebase does)
  • "another master" (let him osqaplus ). We will perform our integration work on this branch, and from time to time we will combine new content with the wizard.
  • Any number of development branches / features that osqaplus needs to fork.

Now, what I would like to do is accept the changes from my own repository (ripper234) and add them to the sghael repository , as if I were originally forked from it . I suppose this will be achieved by creating a new fork and merging my changes there, but I'm too new to git to try to do this on my own. In addition, when I look at the sghael project and click "fork", they simply transfer me to my own repository and the actual fork is not created. Should I rename my existing repo for this?

+4
source share
2 answers

I understand that you want sghael / OSQA to be a ripper234 / osqa fork. If so, you should rename sghael / OSQA (e.g. sghael / OSQA_renamed) and create a new fork from ripper234 / osqa.

Then the only thing missing is pushing the changes you want from sghael / OSQA_renamed to ripper234 / osqa. One way to do this is to add changes to your new fork (sghael / OSQA) and create tensile requests or click directly on ripper234 / osqa, adding it as remote to your sghael / OSQA_renamed repository.

+1
source

if both repositories were created using the same options with git-svn, then the commits will be identical, and both repositories should already be forks (in the sense of git)

to make sure this is the case, you can do the following:

git clone …/OSQA # this will clone the repo and create a remote named 'origin' git remote add ripper …/osqa git fetch gitk --all # you should see all branches, check the svn-history is in fact the same between origin and ripper remotes 
+1
source

Source: https://habr.com/ru/post/1346411/


All Articles