From: Johannes Schindelin Date: Fri, 23 Feb 2007 18:13:35 GMT Subject: Re: git-push hook to update remote working copy safely Message-ID: In-Reply-To: <1172250283.5505.1176180417@webmail.messagingengine.com> Hi, On Sat, 24 Feb 2007, Sam Watkins wrote: > On Fri, 23 Feb 2007 17:40:02 +0100 (CET), "Johannes Schindelin" > said: > > > > On Sat, 24 Feb 2007, Sam Watkins wrote: > > > > > it should merge the changes as if I'd run git-pull on the remote > > > box, and handle conflicts in the same way. > > > > But that leaves conflicts in the working directory! You _have_ to > > resolve them (or reset) before proceding. > > I think it's ok for our application if the push+hook leaves conflicts in > the working directory, I just want to replicate the effect of running > git-pull remotely without actually having to go through ssh contortions > to achieve that. I don't really see what you want to do there (and you don't want to tell me:-)). Nevertheless, it seems that Junio's script would help you. You cannot run a pull sanely when the working directory is dirty, and therefore the hook does not allow that. BTW the easiest way to do what you apparently want is to push to a "remotely tracking" branch, i.e. a branch in the remotes/ hierarchy, and _then_ make an update hook which says "git merge remotes/". Ciao, Dscho