Thread (141 messages) 141 messages, 8 authors, 2026-03-04

Re: Triangular workflow

From: Jeff King <hidden>
Date: 2026-01-13 21:41:01

On Tue, Jan 13, 2026 at 07:35:57PM +0100, Harald Nordgren wrote:
quoted
For my triangular workflow the ahead/behind for the push branch is just
useless noise. I treat my push destination like a mirror, where I always
just push up everything at the end of the day.
This seems like a sub-optimal workflow 🤗

May I ask where you normally push (unless you only ever push once at the
end) of the day? If it's another branch than your mirror, why not set that
as your push destination then, and push to your push destination with the
longer

    git push origin my-mirror

It makes more sense to me to reserve the shorter and more convenient
'git push' for something you do many times a day.
I couldn't quite parse what you meant by "another branch than your
mirror", but I'll describe my workflow:

  1. My "origin" remote is https://github.com/gitster/git.

  2. Most branches have origin/master as their upstream, though
     occasionally I'll have dependent branches that use "." as their
     remote and the local base branch for the "branch" field.

     E.g.

       git checkout -b jk/some-topic origin/master
       ...
       git checkout -t -b jk/another-topic jk/some-topic

  3. My mirror is https://github.com/peff/git, which I call "github" in
     the remote (arguably confusing, but back when I started that
     convention I was pulling Junio's tree from kernel.org ;) ). I point
     remote.pushdefault to the "github" remote.

  4. My push.default setting is "current", so if I want to push up a
     single branch, I can just "git push". I hardly ever do that,
     though.

  5. I usually push once per day or so. After integrating my topics into
     a shared daily-driver branch, I run something like:

       make test && make install && git push -f github refs/heads/jk/*

     (it's not exactly that; I have a script which picks out the local
      refs, but it's the moral equivalent of that).

So I don't ever care about the relationship between a specific jk/foo
and my mirror's version of it. I don't expect anybody to look at those,
and they exist mostly for backup and CI purposes (though I don't run CI
on the individual branches, but only the integrated result).

And having the extra output from "git checkout" is just extra noise for
me, especially because it is easy to see only the second message (which
looks just like the upstream ahead/behind message, of course) and get
confused. The first time I saw it I thought I had misconfigured
something with my branch.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help