On Mon, 09 Nov 2015 17:59:13 +0000
phillip.l...@newcastle.ac.uk (Phillip Lord) wrote:

> I was trying something slightly evil
> though, which breaks this. I've been using unison to sync
> ~/src/my-repo
> between machines.

But why?  If you have unison working between those machines, you most
probably have SSH working as well, so could just use Git for pushing
and fetching.  In most projects (even those like the Linux kernel) and
on a fast filesystem (e.g., extN are OK) the time it takes to
populate/update the work tree is negligible compared to the time it
takes to transfer the history, so why not just stick to Git? ;-)

In case you "kind of heard" exchanging histories between non-bare repos
is a no-no, I can assure you that's nonsense -- while you obey certain
simple rules.  Actually, the single rule: don't try to push to a branch
which is checked out.  And this rule is simple to follow: if you have
repos A and B, and you want to push branch X from A to B, and B has it
checked out then instead fetch X from A while working with B (that is,
reverse the operation).  If it's inconvenient, push X to a temporary
branch while at A, and then update X from that temp branch when back at
B, and delete it.

If you have a dedicated machine which is always available, you can just
create a rendez-vouz bare repo there and exchange your histories
through it -- just like you'd do with github or any other Git hosting.

If you still have some doubts / have things to clear up, just ask away.

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