Note that there are some explanatory texts on larger screens.

plurals
  1. POgit pull subtree deletes everything
    text
    copied!<p>I'm trying to take advantage of the subtree feature in git where I can have a repo that reference an other repo and thus appears to have all the files of both repos. I have read a couple of intros <a href="http://www.kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html" rel="nofollow"><strong>here</strong></a> and <a href="http://git-scm.com/book/en/Git-Tools-Subtree-Merging" rel="nofollow"><strong>here</strong></a> and have tried to follow them.</p> <p>So I have two repos in git hub. I do this </p> <pre><code>git checkout testBranchA git pull origin testBranchA git remote add external git@github.com:reharik/repoB git fetch external git checkout -b external external/testBranchB git read-tree --prefix=src/ -u external git commit -m "added subtree" </code></pre> <p>so now I look at my file sys and I see all the files from both repos and everything is great. Then I do </p> <pre><code>git pull -s subtree external testBranchB </code></pre> <p>and it seems that everything in both local repos is deleted. infact first it does </p> <pre><code>removing src/... </code></pre> <p>on all files, then it seems to do a merge where you see all the files with red and green +'s and -'s, then it does </p> <pre><code>delete mode 100644 src/... </code></pre> <p>for all files</p> <p>So i'm not sure what I'm doing wrong but clearly it's something. </p> <p>Any help would be appreciated</p> <p>=== edit sorry to keep changing the commands, I'm a bit fried at this point but I think this is the syntax I'm using</p>
 

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