Hi Alexandru,

Thanks for your reply, really appreciate it!

Patches do seem like the way to go. Also, I agree that it would be 
important to have a nice workflow if this were to be a continuous 
situation. In our case, this was supposed to be a one-off thing: bring back 
the changes from the new repo into the main repo, move forward like the 
split never happened.

However, I was busy with the repositories and it turns out there were a 
couple of commits to the big repo's related folder after the split as well, 
and this really complicates everything. Especially since the new smaller 
repo has about 90 commits worth of changes after the split. I tried a 
number of different things with *diff*, *format-patch*, *apply*, and *am*; 
but I was not able to successfully replay the changes of the new repo on 
top of the original one. Also, due the large number of changes, applying 
all the changes and patches on a one-by-one basis is not really plausible.

There doesn't seem to be much more to be done here, but I did learn a lot, 
and I guess thte "lesson learned" here was to act more quickly next time in 
a similar situation, before the repos grow too far apar :)

Thanks again for the help,
Amin


On Wednesday, July 5, 2017 at 6:03:49 PM UTC-4, Alexandru Pătrănescu wrote:
>
> Hi Amin,
>
> You an try using a patch: git format-patch and git am.
>
> While you're trying to fix it, you might want to think about creating a 
> unidirectional flow strategy.
>
> Either commit in the big repo and trigger spliting it to small repos by 
> running git subtree for each new commit.
> Or commit in the small repos and trigger updates in the big repo using git 
> submodules.
>
> Regards,
> Alex
>
> On Thu, Jul 6, 2017 at 12:19 AM, Amin <amin.b...@gmail.com <javascript:>> 
> wrote:
>
>> Hi all,
>>
>> A while ago I used git-subtree to break off a sub-directory into its own 
>> branch:
>>
>>     git subtree split -P libs/invariants -b separate_invariants
>>
>> Then I pulled the new `separate_invariants` branch into a new 
>> repository and made a few commits to it.
>>
>> My question is, is there anyway I can merge the new commits from the new 
>> repository back into the original one?
>>
>> I'd like to merge the new commits (after the split) made to the new 
>> repository back into the libs/invariants sub-directory of the original 
>> repository, but the problem is that due to using `git subtree split`, the 
>> new repository doesn't share any history with the original one, so I can't 
>> just do normal rebasing or merging.
>>
>> I'd appreciate any help with my question.
>>
>> Thanks,
>> Amin
>>
>> -- 
>> 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+...@googlegroups.com <javascript:>.
>> 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