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

[Q] push refspec with wildcard pushes all matching branches

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Jan 24, 2020, 20:29 UTC
Message-ID
<ed9a0485-1e6c-79ae-6a59-655105203728@googlemail.com>
Dear all,
I'm a little confused, that a push refspec with a wildcard changes the number of branches pushed.
Here is what I see with Git 2.25:
     $ git --version
     git version 2.25.0
     $ git config --list
     user.email=bert.wesarg@googlemail.com
     user.name=Bert Wesarg
     $ git init --bare bare.git
     $ git clone bare.git repo
     Cloning into 'repo'...
     warning: You appear to have cloned an empty repository.
     done.
     $ cd repo
     $ git config push.default current
     $ echo foo >foo
     $ git add foo
     $ git commit -m foo
     [master (root-commit) 4d0b276] foo
      1 file changed, 1 insertion(+)
      create mode 100644 foo
     $ git branch master-two
     $ git push --dry-run
     To ../bare.git
      * [new branch]      master -> master
     $ git config remote.origin.push 'refs/heads/master*:refs/remotes/origin/master*'
     $ git push --dry-run
     To ../bare.git
      * [new branch]      master -> origin/master
      * [new branch]      master-two -> origin/master-two
Is this expected behavior?
Thanks.

Best, Bert

Next: Jeff King
Message 1 of 16 in “[Q] push refspec with wildcard pushes all matching branches”
  1. Bert WesargJan 24, 2020
  2. Jeff KingJan 25, 2020
  3. Bert WesargJan 25, 2020
  4. doc: clarify "explicitly given" in push.defaultJeff King, Jan 25, 2020
  5. Bert WesargJan 27, 2020
  6. Jeff KingJan 27, 2020
  7. doc: clarify "explicitly given" in push.defaultBert Wesarg, Jan 27, 2020
  8. Jeff KingJan 27, 2020
  9. Junio C HamanoJan 28, 2020
  10. Jeff KingJan 29, 2020
  11. Junio C HamanoJan 29, 2020
  12. Jeff KingJan 29, 2020
  13. Bert WesargJan 27, 2020
  14. Bert WesargJan 27, 2020
  15. Jeff KingJan 27, 2020
  16. Bert WesargJan 28, 2020

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.