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

Best "triangle" workflow setup?

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
May 11, 2017, 19:41 UTC
Message-ID
<CAHd499DjBHsWCf8h+i4EstR7qs-9hkO4En5-B-WA17DoPZQNoQ@mail.gmail.com>

I know Git has evolved to support the "triangle" workflow model in different ways, with the goal of making it better. However because there are so many different options from separate push URLs for remotes to various ways to manage tracking branches, it's not clear to me which specific configuration suits this workflow the best.

So my situation is that I have 3 repositories: The original upstream repository, a fork of that repository (also remote), and my local clone of the upstream repository.

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`).

What is the best way to achieve this? Is there a different workflow from what I'm imagining that works a little better (in other words, I don't need it to work *exactly* as I've described, mainly I just want to avoid accidentally pushing changes to the upstream repo in the default case when I want to push to the fork instead for pull request)?

Thanks in advance for any advice.
Next: Jeff King
Message 1 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.