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

Re: auto-merge after push?

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 11, 2009, 15:18 UTC
Message-ID
<alpine.DEB.1.00.0905111714250.4973@intel-tinevez-2-302>
In-Reply-To
<20090511142326.GA18260@redhat.com>
Hi,
On Mon, 11 May 2009, Michael S. Tsirkin wrote:
Show 10 quoted lines
> I'm working on two machines, and git allows me to switch between them 
> and sync by means of git pull. When one machine is behind a firewall, I 
> can sometimes only do pushes, but then I have to rememeber to merge when 
> I log into remote machine.
> 
> Is there a way to trigger merge on remote after push somehow,
> so that running on local machine:
> >git push remote
> would be equivalent to
> >ssh remote git pull local
How about something like
$ git config alias.reverse-pull '!sh -c "git push remote HEAD:TO_MERGE && \
	ssh remote \"cd directory && \
		git merge TO_MERGE && git branch -d TO_MERGE\""'
?

The thing is, a merge can fail. And then you already need direct access to the working directory in question.

If you were actually talking about fast-forward pushes (because you did the merge locally already), this might help you:

	http://thread.gmane.org/gmane.comp.version-control.git/110251

Ciao, Dscho

Previous: Jakub NarebskiNext: Michael S. Tsirkin
Message 3 of 18 in “auto-merge after push?”
  1. Michael S. TsirkinMay 11, 2009
  2. Jakub NarebskiMay 11, 2009
  3. Johannes SchindelinMay 11, 2009
  4. Michael S. TsirkinMay 11, 2009
  5. Johannes SchindelinMay 11, 2009
  6. Michael S. TsirkinMay 11, 2009
  7. Johannes SchindelinMay 11, 2009
  8. Michael S. TsirkinMay 19, 2009
  9. Michael S. TsirkinJun 11, 2009
  10. Michael S. TsirkinJul 11, 2009
  11. Johannes SchindelinJul 12, 2009
  12. Junio C HamanoJul 12, 2009
  13. Johannes SchindelinJul 12, 2009
  14. Michael S. TsirkinJul 15, 2009
  15. Junio C HamanoJul 15, 2009
  16. Michael S. TsirkinJul 15, 2009
  17. Johannes SchindelinJul 16, 2009
  18. Johannes SchindelinMay 11, 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.