From: Nanako Shiraishi Date: Tue, 04 Aug 2009 21:15:04 GMT Subject: Re: How to push properly a la subversion Message-ID: <20090805061504.6117@nanako3.lavabit.com> In-Reply-To: <111060c20908040017y753a3cb4mbc4d7654192a5d1a@mail.gmail.com> Quoting Matthieu Stigler > 2009/7/30 Dmitry Potapov : > > Second, you said >> So, your normally should never push to the branch that is currerently checked out. (New versions of Git will warn you about that). > > Is there a way to avoid that? Manually, do I just need on post A > (against which it was pushed from clone B) to use: > git-reset --hard HEAD > > And if yes, can I automate that in hooks/post-update in A? Or post-commit in B? The standard way to communicate changes to a repository with a working tree A from your repository B is to pretend as if A fetches from B even when you are pushing from B to A.. Here are some recommended readings: * http://git.or.cz/gitwiki/GitFaq#Whywon.27tIseechangesintheremoterepoafter.22gitpush.22.3F * http://git.or.cz/gitwiki/GitFaq#push-is-reverse-of-fetch * "Push into another repository" item in http://www.kernel.org/pub/software/scm/git/docs/everyday.html illustrates this with an example. * http://article.gmane.org/gmane.comp.version-control.git/123331 -- Nanako Shiraishi http://ivory.ap.teacup.com/nanako3/