-1

I would like to merge the following GitHub repositories:

In so doing, I would like to make it so this merger ends up looking like robertvojta/objc4 in terms of how its commits, releases, tags, etc., are organized. Is this possible, and, if so, how would I do it? I assume that I won't be able to merge all of the repositories together all at once; so, in which order should I merge the repositories in question; and how would I perform each merger such that I would be able to get the desired results in the end?


P. S.:

OK, so I've started my attempt at merging all of these repositories, but it seems to that macmade/OBJC4-437.1-Runtime, which is the first repository which I think that I will have to merge into RandomDSdevel/objc4, my target repository, because of how this source repository contains files from the earliest version of Objective-C available on GitHub, might be a little tricky to merge. You see, macmade/OBJC4-437.1-Runtime contains what you'd get if you went to Apple's open-source web site, looked under the 'OS X' column for '10.6,' clicked the disclosure triangle to show this parent item's children, clicked on any of the links in the section of the sub-list from '10.6.2' through '10.6.7,' scrolled down to find 'objc4-437.1,' downloaded the source code, went to wherever you saved this download, deleted everything but the 'runtime' folder, extracted its contents into wherever it resided, deleted the (now empty) 'runtime' folder, and made the resulting folder into a GitHub repository.

Anyway, none of the other GitHub repositories containing Objective-C source code have undergone this kind of lobotomy, which means that I'll need to make it so that I can merge the contents of a branch of my (RandomDSdevel's) 'objc4' repository which I made it to track macmade's 'OBJC4-437.1-Runtime' repository into a 'runtime' folder in my (RandomDSdevel's) 'objc4' repository's 'master' branch. So far I've found several different strategies that I could possibly use to merge this 'macmade' branch of my (RandomDSdevel's) 'objc4' repository into the 'master' branch of this repository. Most of them are described in this Stack Overflow question and its answers. That question's first comment also mentions that other solutions may be found in the contents of the discussion surrounding this Stack Overflow question, and one of that question's answers refers the person who originally asked the question to Linus Torvalds's 'coolest merge ever'.

Which of these strategies should I use to merge my (RandomDSdevel's) mirror of macmade's 'OBJC4-437.1-Runtime' repository into my (RandomDSdevel's) 'objc4' repository's 'master' branch such that the former's contents end up in the latter's 'runtime' folder? Could somebody walk me through this, step by step, please? After that, though, I can probably just merge all of the other repositories that I initially mentioned in on top of the merge I want help with from least to greatest version as originally suggested by Mudassir Razvi in his original answer to this question.

Community
  • 1
  • 1
RandomDSdevel
  • 431
  • 6
  • 17

1 Answers1

1

Anyhow! You can checkout RandomDSdevel/robertvojta_objc4, add all the other repositories as remotes, fetch from all of them (order does not matter), and merge whatever you need, wherever you need!

A more sensible way would be to add one repo as remote, fetch, merge, add another and repeat cycle so as to avoid confusion!

Update-1

  1. If you want just the content:
    a. Create a Git repository
    b. In your new empty repo, Add each of your repositories in folders and commit one at a time.

  2. If you want their histories:
    a. Create an empty repo, add all your repositories as Sub-Modules.
    b. Then refer this.
Community
  • 1
  • 1
Mudassir Razvi
  • 1,783
  • 12
  • 33
  • OK, I was able to merge all of the repositories containing Objective-C v4r551.1 but am having trouble reverting [robertvojta_objc4](https://github.com/RandomDSdevel/robertvojta_objc4) to earlier commits to it in order to merge those of the repositories which I mentioned above that contain versions of Objective-C earlier than v4r551.1 into these earlier commits so as to maintain the history of all branches. Should I maybe start over and merge from earliest version to latest version? – RandomDSdevel Sep 19 '14 at 20:37
  • 1
    @RandomDSdevel That is what you have to do! :) – Mudassir Razvi Sep 22 '14 at 05:18
  • OK, then; I'll try that and see how it goes. I do still have one question, though: how am I going to handle merging [RandomDSdevel/macmade_OBJC4-437.1-Runtime](https://github.com/RandomDSdevel/macmade_OBJC4-437.1-Runtime) into the '`runtime`' folder of one of the other repositories? Also, should I work from my forks or from the original repositories? – RandomDSdevel Sep 22 '14 at 20:56
  • I can't seem to revert my first try at merging all of these repositories, so I'm going to try again, but working from the original repositories and putting the results in a single repository of mine this time. – RandomDSdevel Sep 22 '14 at 21:07
  • I would prefer you work from forks and leave originals alone, so that they can come to your rescue if you mess up. regarding your runtime question, I didn't quite understand it. :) – Mudassir Razvi Sep 23 '14 at 05:30
  • What I meant when I said that I was wondering whether I should work from forks or originals, I meant that I was wondering whether I should fork the originals before making them all remote repositories to a new repository or just use the originals as my remotes. As for what I asked about the `runtime` folder, I was trying to ask how I could merge [madmade's Objective-C 437.1 repository](https://github.com/macmade/OBJC4-437.1-Runtime) into one of the other repositories to which I have referred even though it only contains the contents of the other repositories' `runtime` folders. – RandomDSdevel Sep 23 '14 at 16:48
  • In essence, the first merge that I think I need to do might be one in which I will merge [macmade](https://github.com/RandomDSdevel/objc4/tree/macmade) with [master](https://github.com/RandomDSdevel/objc4/tree/master) by grafting [macmade](https://github.com/RandomDSdevel/objc4/tree/macmade) into [master](https://github.com/RandomDSdevel/objc4/tree/master) at [master/runtime](https://github.com/RandomDSdevel/objc4/tree/master/runtime) so that I will be able to do all of the other merges on top of this. The problem is that I don't exactly know how to do something like that! – RandomDSdevel Sep 23 '14 at 17:50
  • [This Stack Overflow question](http://stackoverflow.com/questions/6426247/merge-git-repository-in-subdirectory) talks about how one can merge one git repository into a subfolder of another, but I need help understanding it and the pages to which it links! – RandomDSdevel Sep 23 '14 at 17:52
  • Can anybody help me do the above so that I can perform the first of my sequence of repository mergers? – RandomDSdevel Sep 26 '14 at 22:36
  • (at)Mudassir Razvi: If you're confused by all of the comments, I've updated my original question above with a postscript that might clarify things somewhat for you. – RandomDSdevel Sep 27 '14 at 18:38
  • @MudassirRasvi: See the last comment; '@' was misbehaving when I tried to use it with the version of your user named that has a space in it… – RandomDSdevel Oct 05 '14 at 20:57
  • Hello? Is anybody home? – RandomDSdevel Oct 08 '14 at 22:59
  • Curse my luck; nobody, not even somebody other than the person who originally attempted to answer my question, seems to be home! – RandomDSdevel Oct 09 '14 at 22:02
  • 1
    @RandomDSdevel Sorry I was out. Help me understand one thing, If I am right you want all the contents of all the repositories you listed on one branch right? (Also do you want the complete history of all the branches? ) – Mudassir Razvi Oct 11 '14 at 10:33
  • _Yes!_ That is _exactly_ what I want! Can you help me figure out how to make that happen? – RandomDSdevel Oct 11 '14 at 19:43
  • I asked two different things. :( If you want only the content then its very easy, but if you want complete history then its very tricky. :( – Mudassir Razvi Oct 13 '14 at 05:01
  • Sorry; I thought I was saying 'yes' to both parts of your question. How tricky will this turn out to be, anyway? – RandomDSdevel Oct 13 '14 at 20:06
  • Actually, I did a Google search on how to merge sub-modules into their parent repositories and found that [_this_](http://x3ro.de/2013/09/01/Integrating-a-submodule-into-the-parent-repository.html), which poses itself as a better alternative to the procedure outlined in the answer that you referenced, may be a better way for me to do step '2b.' – RandomDSdevel Oct 14 '14 at 19:08
  • Tried following the [directions](http://x3ro.de/2013/09/01/Integrating-a-submodule-into-the-parent-repository.html) I mentioned and kept getting errors as discussed [here](http://x3ro.de/2013/09/01/Integrating-a-submodule-into-the-parent-repository.html#comment-1635564277). It's kind of annoying, you know? In fact, should I just use the instructions that you gave me? – RandomDSdevel Oct 17 '14 at 18:54
  • I've put more information on the problems that I've encountered with this first merge into [this Stack Overflow question](http://stackoverflow.com/questions/26454893/error-merging-a-git-submodule-into-its-parent-repository-in-os-x). Thankfully, I shouldn't have to deal with submodules after this initial merge! – RandomDSdevel Oct 19 '14 at 20:11
  • @MudassirRasvi: I'm still having trouble with this first step, though…do you think you can help me? – RandomDSdevel Oct 28 '14 at 21:40
  • @MudassirRasvi: Somebody answered that other question I mentioned, so I _should_ be able to get through this mess now. – RandomDSdevel Oct 30 '14 at 19:04
  • @MudassirRasvi: **Correction:** Somebody is _in the process of answering_ my other question. (Heh, heh…) – RandomDSdevel Oct 30 '14 at 20:44
  • @MudassirRasvi: I have successfully completed the first merge operation that is part of this more complicated one! Now I just need to do the _rest_ of them; thankfully, this will be _easy_ now that I don't have to go to the trouble of messing around with directory trees. – RandomDSdevel Oct 31 '14 at 00:09
  • @MudassirRasvi: Well, I've decided to redo what I just did using a fork like you suggested, but now I'd like to merge the changes which I made to this fork of the first repository back into its upstream repository and then merge _that_ repository into my merger target and can't seem to create a pull request for that…!?! [How in the _multiverse_ would I do _that_?](http://stackoverflow.com/questions/26683569/merging-a-fork-in-which-history-was-completely-rewritten-back-into-its-base-repo) – RandomDSdevel Oct 31 '14 at 21:21
  • @MudassirRasvi: Um…are you listening, or have you wandered off again? – RandomDSdevel Nov 12 '14 at 13:39
  • Ugh…I'm having a lot of trouble with this, so I'm going to start fresh with a new '`objc4`' repository. – RandomDSdevel Nov 18 '14 at 19:40