From: Sam Watkins Date: Fri, 23 Feb 2007 16:35:00 GMT Subject: Re: git-push hook to update remote working copy safely Message-ID: <1172248500.32514.1176151445@webmail.messagingengine.com> In-Reply-To: <7v649t5ebq.fsf@assigned-by-dhcp.cox.net> On Fri, 23 Feb 2007 03:00:09 -0800, "Junio C Hamano" said: > "Sam Watkins" writes: > > > I'm looking for a command that will update the remote working copy after > > a "git push", without damaging any changes that may have been made to > > the working copy. > > Define "without damaging". If there are changes to paths that > are modified by the pushed commit since the current HEAD, what > should your "update the remote working copy" procedure would > do? hi Junio, it should merge the changes as if I'd run git-pull on the remote box, and handle conflicts in the same way. If possible I want to get exactly the effect of having run on box B "git-pull A", by running a command like "git-push B" on box A. I think maybe that's not possible without commiting all changes to the working copy on B first, but for our app it's fine to do that it's meant to do that automatically and frequently anyway. so I will just do that then run checkout -f from the hook. I don't understand git very well yet but that will work I think. I thought "push" would be symmetrical to "pull" more or less, maybe it is symmetrical to "fetch" ? thank-you for your help, I am reading some more of the git manual because I understand only some of your reply and very little about git yet! The app "arcs" we are writing, it is peer to peer, not necessarily using a central repository, it commits pulls and pushes all changes made to working copies automatically or when asked to. currently I'm implementing push as a remote pull because of this problem, but that can't connect back through firewalls and suchlike. Sam