Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It happened to us that we created 2 repositories for 2 projects that were so coupled that didn't make any sense to have them separated, so we merged them.</p> <p>I'll show how to merge the master branches in each first and then I will explain how you can extend this to every branches you got, hope it helps you.</p> <p>If you got the submodule working, and you want to convert it to a directory in place you can do:</p> <pre><code>git clone project_uri project_name </code></pre> <p>Here we do a clean clone to work. For this process you don't need to initialize or update the submodules, so just skip it.</p> <pre><code>cd project_name vim .gitmodules </code></pre> <p>Edit <code>.gitmodules</code> with your favorite editor (or Vim) to remove the submodule you plan to replace. The lines you need to remove should look something like this:</p> <pre><code>[submodule "lib/asi-http-request"] path = lib/asi-http-request url = https://github.com/pokeb/asi-http-request.git </code></pre> <p>After saving the file,</p> <pre><code>git rm --cached directory_of_submodule git commit -am "Removed submodule_name as submodule" rm -rf directory_of_submodule </code></pre> <p>Here we remove the submodule relation completely so we can create bring the other repo to the project in-place.</p> <pre><code>git remote add -f submodule_origin submodule_uri git fetch submodel_origin/master </code></pre> <p>Here we fetch the submodule repository to merge.</p> <pre><code>git merge -s ours --no-commit submodule_origin/master </code></pre> <p>Here we start a merge operation of the 2 repositories, but stop before commit.</p> <pre><code>git read-tree --prefix=directory_of_submodule/ -u submodule_origin/master </code></pre> <p>Here we send the content of master in the submodule to the directory where it was before prefixing a directory name</p> <pre><code>git commit -am "submodule_name is now part of main project" </code></pre> <p>Here we complete the procedure doing a commit of the changes in the merge.</p> <p>After finishing this you can push, and start again with any other branch to merge, just checkout the branch in you repository that will receive the changes and change the branch you bringing in the merge and read-tree operations.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload