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

git push first asks for credentials, then checks the branch exists

From
DDmitry <wipedout@yandex.ru>
Date
Mar 5, 2014, 09:36 UTC
Message-ID
<259061394012172@web5j.yandex.ru>
Hi,
Here's my usecase. I have created a BranchWithVeryLongName and I want to have it pushed to origin. So I use this command with version 1.8.1.2:
git push origin BranchMistypedLongName
(note that I mistyped the branch name). The following happens:
1. git asks me for username and password
2. it authenticates on the origin server
3. it bails out with "error: sfc refspec BranchMistypedLongName does not match any"
Can't git perhaps check that the branch exists before it asks me for credentials and just say there's no such branch?
Could you please fix this?

Thank you. Dmitry.

Next: Jeff King
Message 1 of 7 in “git push first asks for credentials, then checks the branch exists”
  1. DmitryMar 5, 2014
  2. 0/3 push: detect local refspec errors earlyJeff King, Mar 5, 2014
  3. 1/3 match_explicit: hoist refspec lhs checks into their own functionJeff King, Mar 5, 2014
  4. 2/3 match_explicit_lhs: allow a "verify only" modeJeff King, Mar 5, 2014
  5. 3/3 push: detect local refspec errors earlyJeff King, Mar 5, 2014
  6. Junio C HamanoMar 5, 2014
  7. Jeff KingMar 5, 2014

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.