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

Re: Best "triangle" workflow setup?

From
Jeff King <peff@peff.net>
Date
May 11, 2017, 20:17 UTC
Message-ID
<20170511201707.aobrdiompzg6wu5k@sigill.intra.peff.net>
In-Reply-To
<CAHd499DjBHsWCf8h+i4EstR7qs-9hkO4En5-B-WA17DoPZQNoQ@mail.gmail.com>
On Thu, May 11, 2017 at 02:41:41PM -0500, Robert Dailey wrote:
Show 6 quoted lines
> What I want (as a default) is for `git pull` to pull from the
> same-named branch on the upstream repository, but for `git push` to
> push to the same-named branch on the fork repository. However to
> override this behavior for when I want to push directly to upstream
> repo, I should be able to use an explicit `git push origin my-topic`
> (but `git push` by default will act as `git push fork my-topic`).
I think you want:
  [push]
  default = current
  [remote]
  pushDefault = myfork

to make "git push" do what you want. And then generally have branches mark their counterparts on "origin" (which you can do either at creation time, or probably by using "git push -u origin my-topic" when you push them).

This is similar to what I do for my git.git workflow, though I usually have origin/master as the branch's upstream. I.e., I'd create them with:

  git checkout -b my-topic origin

And then rebasing always happens on top of master (because "origin" doesn't even have my topic branch at all). If I want to compare with what I've pushed to my fork, I'd use "@{push}".

-Peff
Previous: Robert DaileyNext: Robert Dailey
Message 2 of 6 in “Best "triangle" workflow setup?”
  1. Robert DaileyMay 11, 2017
  2. Jeff KingMay 11, 2017
  3. Robert DaileyMay 11, 2017
  4. Jeff KingMay 11, 2017
  5. Robert DaileyMay 12, 2017
  6. Jeff KingMay 13, 2017

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.