Like I said, I've not used it, but a little googling (`working with git 
subtree`) got 
https://www.atlassian.com/blog/git/alternatives-to-git-submodule-git-subtree or 
https://medium.com/@porteneuve/mastering-git-subtrees-943d29a798ec
which looks like it might be a reasonable discussion.

It maybe that it doesn't fully suit your workflow, but I thought it worth 
mentioning.

I think the key for you maybe finding the 'subtree split' command and seeing if 
that does it (the initial splitting of B from A) for you.

Happy hunting.


Philip
  ----- Original Message ----- 
  From: Gabby Romano 
  To: git-users@googlegroups.com 
  Sent: Monday, June 05, 2017 7:05 PM
  Subject: Re: [git-users] patch git repo from another repo


  thanks Philip.


  if I need to update a sub folder (not a sub tree), how can I use the sub tree 
merge ? 
  I have the sub folder in repo A and would like to apply the commits for this 
folder on repo B, which file paths had changed there along with sha-1's since I 
had to filter-branch repo B to create it out of repo A. 


  I know it's a bit twisted but it's a temp situation which I need to gap over 
for a while. 



  On Mon, Jun 5, 2017 at 6:51 PM, Philip Oakley <philipoak...@iee.org> wrote:

    Hi Gabby,

    If you are looking at a single directory / sub-tree of the main repo, then 
maybe have a look at the "Sub-tree merge" capability. I have not used it 
myself, but it sounds like it matches your use case. 

    [The main Git project uses it for merging in the git-gui and gitk 
repositories].

    Philip
      ----- Original Message ----- 
      From: Gabby Romano 
      To: Git for human beings 
      Sent: Monday, June 05, 2017 1:26 PM
      Subject: [git-users] patch git repo from another repo


      hi guys, 


      I have repo A and repo B which is a subset of A by extracting folder 
related commits and creating a new repo out of it. 
      since it was done with filter-branch there are new SHA1's and files paths 
had changed to some extent as well.
      my question is - if I would like to keep syncing repo B from repo A - 
what is the best way to do it ?


      I have tried using this - git --git-dir=<A.git folder> format-patch -k -1 
--stdout <sha1> |git am -3  -k


      I got this - 


      fatal: sha1 information is lacking or useless (<some path>).
      error: could not build fake ancestor


      I guess this is confusing to Git but I feel there should be a good way to 
do this. is there ?


      Thanks.

      -- 
      You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
      To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+unsubscr...@googlegroups.com.
      For more options, visit https://groups.google.com/d/optout.


    -- 
    You received this message because you are subscribed to a topic in the 
Google Groups "Git for human beings" group.
    To unsubscribe from this topic, visit 
https://groups.google.com/d/topic/git-users/DSIY7j8ZLdM/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to 
git-users+unsubscr...@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.




  -- 
  You received this message because you are subscribed to the Google Groups 
"Git for human beings" group.
  To unsubscribe from this group and stop receiving emails from it, send an 
email to git-users+unsubscr...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to