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

Re: Triangular workflow with Central repo

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 25, 2014, 17:32 UTC
Message-ID
<xmqqionoao9c.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CANR0-ag4ZKmHBNPxYkohBJEpXierFV+K3Ub4tH8YYD7FK73FdA@mail.gmail.com>
Mark Ferrell <major@homeonderanged.org> writes:
> push repository, but our use case relies on the pull branch being
> different than the push branch.  It would seem that git would need a
> branch.<name>.push directive for this to work out.

I thought that you can tell recent versions of Git to pay attention to the remote.*.push patterns and use them as a refmap even when you are pushing a single branch?

Here is a demonstration:
 $ (git init src && cd src && git commit --allow-empty -m foo)
 $ git clone src dst
 $ cd dst
 $ edit .git/config ; cat .git/config
 [core]
         repositoryformatversion = 0
         filemode = true
         bare = false
         logallrefupdates = true
 [remote "origin"]
         url = ../src
         fetch = +refs/heads/*:refs/remotes/origin/*
         push = refs/heads/*:refs/heads/dev/me/*
 # note that I edited out [branch "master"] section to show that
 # you do not even need per-branch configuration.
 $ git commit --allow-empty -m bar
 $ git push
 Counting objects: 1, done.
 Writing objects: 100% (1/1), 184 bytes | 0 bytes/s, done.
 Total 1 (delta 0), reused 0 (delta 0)
 To ../src
  * [new branch]      master -> dev/me/master

For simplicity I used two local repositories and used a random pattern "refs/heads/dev/me/*", trusting that the readers are capable of updating the example to use remote URLs and different hierarchies as needed.

Previous: Mark Ferrell
Message 2 of 2 in “Triangular workflow with Central repo”
  1. Mark FerrellJun 23, 2014
  2. Junio C HamanoJun 25, 2014

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.