Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can do what you are describing like this:</p> <ol> <li><p>Move the content of <code>ABC</code> to an <code>ABC/</code> subdirectory, and fix the history so that it looks like it has always been there:</p> <pre><code>$ cd /path/to/ABC $ git filter-branch --index-filter \ 'git ls-files -s | sed "s-\t-&amp;ABC/-" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ git update-index --index-info &amp;&amp; mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD </code></pre> <p>Now your directory structure is <code>ABC/ABC/your_code</code></p></li> <li><p>Same for the content of <code>DEF</code>:</p> <pre><code>$ cd /path/to/DEF $ git filter-branch --index-filter \ 'git ls-files -s | sed "s-\t-&amp;DEF/-" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new \ git update-index --index-info &amp;&amp; mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE' HEAD </code></pre> <p>Now your directory structure is <code>DEF/DEF/your_code</code></p></li> <li><p>Finally, create the <code>PPP</code> repository and pull both <code>ABC</code> and <code>DEF</code> into it:</p> <pre><code>$ mkdir /path/to/PPP $ cd /path/to/PPP $ git init $ git pull /path/to/ABC $ git pull /path/to/DEF </code></pre> <p>Now you have <code>PPP/ABC/your_code</code> and <code>PPP/DEF/your_code</code>, along with all the history.</p></li> </ol> <p>You should probably ask you collegues to run the previous commands on their system, in order for everyone to be synchronized.</p> <blockquote> <p><strong>Note:</strong> the funky <code>filter-branch</code> commands <a href="http://www.kernel.org/pub/software/scm/git/docs/git-filter-branch.html" rel="noreferrer">come from the man page</a>. :-)</p> </blockquote>
 

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