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

"git push" says "src refspec XYZ matches more than one" even without explicit XYZ argument.

From
KGKannan Goundan <kannan@cakoose.com>
Date
Oct 28, 2016, 03:00 UTC
Message-ID
<CAM7aVoUOxx6Fa+yG2JzQhoX-mE4Lgp9ejvwncx5bdL+1tuQQFg@mail.gmail.com>
1. My repo has a branch named 'v1' that is tracking 'origin/v1'.
2. My repo has a tag named 'v1'.
3. I have "push.default" set to "upstream".
I made a commit on branch 'v1' and tried doing a push:
    # git push
    error: src refspec v1 matches more than one.
    error: failed to push some refs to 'git@github.com:whatever/ns1-go.git'
If I rename the branch to 'v1-dev', then the push goes through.

I understand why the command "git push origin/v1 v1" is ambiguous. But if I do a plain "git push", I thought Git would know to push my current branch.

[Git version 2.10.1 from Homebrew on Mac OS 10.11.6.]
Next: Junio C Hamano
Message 1 of 2 in “"git push" says "src refspec XYZ matches more than one" even without explicit XYZ argument.”
  1. Kannan GoundanOct 28, 2016
  2. Junio C HamanoOct 28, 2016

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.