I'm trying to merge a subfolder of master
branch of repository2
into master
branch of repository1
, using the steps in this answer by @VonC - How do I merge a sub directory in git?
I perform the first two steps with success (adding the repository2
remote, within the master
branch of repository1
, then performing an 'empty' merge from repository2
to repository1
). The structure of my repositories is like this:
repository2/master
DataLib
MessagingLib.V2
.... files I want to merge into my repository1 branch
repository1/master
MessagingLib
.... files I want to merge the repository2 changes into
I have repository1
master
branch checked out. So for the git read-tree
, I use this command:
git read-tree --prefix=MessagingLib.V2/ -u repository2/master:repository1/MessagingLib
But I get the error
fatal: Not a valid object name repository2/master:repository1/MessagingLib
What's the read-tree
command I need?
Update
These don't work either:
git read-tree --prefix=DataLib/MessagingLib.V2/ -u repository2/master:repository1/MessagingLib
git read-tree --prefix=DataLib/MessagingLib.V2/ -u repository2/master:repository1/master