Help merging two repo without connection

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Help merging two repo without connection

From: Luca Siciliano Viglieri <hidden>
Date: 2016-06-15 22:45:39

Hi,
i'm trying to keep synched two repositories without always having a   
direct connection.
My situation is the following:
I have a project on my computer with GIT repo.
Another developer visited me and cloned my repository connecting the  
two computer (for example via  SSH).
Than i sent him for the next days patched of my changes but when he  
came and we merged i got the following tree:

                                                               /  
-------------------------------------------(my patch)--(my second  
patch)--\
                                                              /                                                                                                                      \
-- (first commit) -- (second  
commit 
)                                                                                                                        (merge 
) --
                                                               
\                                                                                                                      /
                                                               \ (my  
patch)--(my second patch)--------------------------------------------/


I don't thinks its right to have double (or more?) commits. I would  
have expected something like:


-- (first commit) -- (second commit)  -- (my patch)--(my second  
patch)  --  (merge?) --


The patches were created with git-format-patch and merged with git-am.
I know that the commits have different sha1 but how can i keep with  
patches or something similar the two repositories exactly synched?

Thanks

Luca Siciliano

Re: Help merging two repo without connection

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:45:39

On Sun, Nov 16, 2008 at 15:59, Luca Siciliano Viglieri
[off-list ref] wrote:
Hi,
i'm trying to keep synched two repositories without always having a  direct
connection.
My situation is the following:
I have a project on my computer with GIT repo.
Another developer visited me and cloned my repository connecting the two
computer (for example via  SSH).
Than i sent him for the next days patched of my changes but when he came and
we merged i got the following tree:
I suspect 'git rebase' might help you out. When you apply the patches,
apply them to the branch they were based off (instead of to the most
recent master), and then rebase -that- branch (with your 'git am'-ed
patches from your other box) onto your most recent master. That way
you should be able to keep  a linear history :).

-- 
Cheers,

Sverre Rabbelier

Re: Help merging two repo without connection

From: Peter Harris <hidden>
Date: 2016-06-15 22:45:39

On Sun, Nov 16, 2008 at 9:59 AM, Luca Siciliano Viglieri wrote:
Hi,
i'm trying to keep synched two repositories without always having a  direct
connection.
...
I don't thinks its right to have double (or more?) commits. I would have
expected something like:


-- (first commit) -- (second commit)  -- (my patch)--(my second patch)  --
 (merge?) --


The patches were created with git-format-patch and merged with git-am.
I know that the commits have different sha1 but how can i keep with patches
or something similar the two repositories exactly synched?
If you use "git bundle" instead of format-patch, you will have an
unreadable binary blob instead of a human-readable patch, but the
sha1s will not change (since the commiter information will be the
same). The remote side will "git pull" the bundle file instead of "git
am"ing it.

Peter Harris
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help