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

Re: Best "triangle" workflow setup?

From
RDRobert Dailey <rcdailey.lists@gmail.com>
Date
May 11, 2017, 21:23 UTC
Message-ID
<CAHd499AvDRH-KZ7piOE=QsVXSpMt0u5jVXUC=7UPnRVLYo-U5Q@mail.gmail.com>
In-Reply-To
<20170511201707.aobrdiompzg6wu5k@sigill.intra.peff.net>
On Thu, May 11, 2017 at 3:17 PM, Jeff King <peff@peff.net> wrote:
Show 11 quoted lines
> 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).

So without the `pushDefault` setting, `current` will default to a remote named `origin` if there is no tracking branch set, correct? So `pushDefault` is effectively overriding this built-in default? In addition, it seems like since this overrides `branch.name.remote`, that this effectively makes the remote tracking branch *only* for `pull`. Is this a correct understanding?

> 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

I'm looking through the `git checkout` and `git branch` documentation, but I don't see any mention of it being valid to use a remote name as the <start-point> parameter (you're using `origin` in the above example). Am I misunderstanding? Did you mean origin/my-topic?

> 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}".

Can you explain more about how your rebase chooses master instead of your same-named remote tracking branch? Maybe provide some examples of your rebase command and respective configuration (unless what you've already provided is sufficient). As for @{push}, I haven't used this before, so I'll dig in the docs and learn about it.

Thanks for your advice, so far I like this direction but seems like there is more for me to learn!

Previous: Jeff KingNext: Jeff King
Message 3 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.