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

Re: Using the --track option when creating a branch

From
Sam Vilain <sam@vilain.net>
Date
Oct 30, 2008, 18:00 UTC
Message-ID
<1225389626.19891.35.camel@maia.lan>
In-Reply-To
<2008-10-30-15-56-34+trackit+sam@rfc1149.net>
On Thu, 2008-10-30 at 15:56 +0100, Samuel Tardieu wrote:
Show 27 quoted lines
> * Pierre Habouzit <madcoder@debian.org> [2008-10-30 15:41:07 +0100]
> 
> | On Thu, Oct 30, 2008 at 02:23:16PM +0000, Samuel Tardieu wrote:
> | > I think it would be better to have :
> | > 
> | >   git push                <= push the current branch
> | >   git push --all          <= push all matching refs
> | >   git push --all --create <= push all matching refs, create if needed
> | > 
> | > The latest command is probably used so rarely (compared to the others)
> | > that it wouldn't be a problem to make it longer. Of course, if a
> | > refspec is given explicitely, it should be honored and remote refs
> | > created if needed.
> | 
> | Fwiw I'm in favor of that, and it was what I advocated at the time.
> | 
> | Though I think than as soon as you add an explicit remote name, like:
> | git push origin, pushing all matched references makes sense. Which is
> | also what I advocated at the time.
> 
> Indeed, it makes sense. We could then have:
> 
>   git push                 <= push the current branch on default remote
>                               (which is, at least in my case, the most
>                                frequent use I want to make of "git push",
>                                on all the projects [work or volunteer]
>                                I work on)
>   git push remote          <= push all matching refs on named remote

I think that 'git push origin' should be the same as 'git push'; so, 'git push remote' would then just push the current head to the tracking branch of that remote. This exposes another issue with the current method of configuring the tracking branch, which is that only one remote and branch may be configured for each local branch. In reality, someone might be pushing and pulling from multiple remotes; expecting them to keep naming the current branch all the time seems arduous.

I think if you want matching refs to be pushed, say so:
  git push remote --matching
>   git push --all [remote]  <= push and create all refs on remote (or default)
Previous: Samuel TardieuNext: Andreas Ericsson
Message 13 of 23 in “Using the --track option when creating a branch”
  1. Bill LearOct 29, 2008
  2. Santi BéjarOct 29, 2008
  3. Bill LearOct 29, 2008
  4. Sam VilainOct 30, 2008
  5. Bill LearOct 30, 2008
  6. Bill LearOct 30, 2008
  7. Andreas EricssonOct 30, 2008
  8. Samuel TardieuOct 30, 2008
  9. Andreas EricssonOct 30, 2008
  10. Samuel TardieuOct 30, 2008
  11. Pierre HabouzitOct 30, 2008
  12. Samuel TardieuOct 30, 2008
  13. Sam VilainOct 30, 2008
  14. Andreas EricssonOct 30, 2008
  15. Samuel TardieuOct 30, 2008
  16. Andreas EricssonOct 30, 2008
  17. Bill LearOct 30, 2008
  18. Marc BranchaudOct 30, 2008
  19. Sam VilainOct 30, 2008
  20. Jakub NarebskiOct 30, 2008
  21. Jeff KingNov 2, 2008
  22. Sam VilainOct 30, 2008
  23. Santi BéjarOct 30, 2008

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.