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

Re: Git-Automerge

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Apr 4, 2010, 16:53 UTC
Message-ID
<vpqr5mv40s2.fsf@bauges.imag.fr>
In-Reply-To
<w2j1f05046e1004040947k3b812063ndbc2f8da3496effb@mail.gmail.com>
Nico Schümann <nico.schuemann@googlemail.com> writes:
> But the changes do not appear on the master server. I have to type
>
> # git reset --hard      or
> # git checkout -f

You pushed to a checked-out branch. You shouldn't do that, and recent Git prevent you from doing it.

The reason Git cannot do the merge automatically is that a merge can go wrong, and may require a human interaction to resolve conflicts. Hence, "push" never does a merge, only "pull" (and obviously local merge) will do.

You can do
client-machine$ git push URL-OF-SERVER HEAD:tmp

to push your current HEAD to a branch named "tmp" on the server, and then

server-machine$ git merge tmp

to merge the changes in the current branch of the server. Another option is to have a bare repository reachable from both machines, and both machine would push/pull to this repository (just like you'd do with a centralized version control system).

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Nico SchümannNext: Ramkumar Ramachandra
Message 2 of 3 in “Git-Automerge”
  1. Nico SchümannApr 4, 2010
  2. Matthieu MoyApr 4, 2010
  3. Ramkumar RamachandraApr 4, 2010

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.