git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to push properly a la subversion

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Aug 4, 2009, 21:15 UTC
Message-ID
<20090805061504.6117@nanako3.lavabit.com>
In-Reply-To
<111060c20908040017y753a3cb4mbc4d7654192a5d1a@mail.gmail.com>
Quoting Matthieu Stigler <matthieu.stigler@gmail.com>
Show 10 quoted lines
> 2009/7/30 Dmitry Potapov <dpotapov@gmail.com>:
>
> 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/
Previous: Dmitry Potapov
Message 7 of 7 in “How to push properly a la subversion”
  1. Matthieu StiglerJul 29, 2009
  2. Avery PennarunJul 29, 2009
  3. Dmitry PotapovJul 29, 2009
  4. Dmitry PotapovJul 30, 2009
  5. Matthieu StiglerAug 4, 2009
  6. Dmitry PotapovAug 4, 2009
  7. Nanako ShiraishiAug 4, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.