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

git checkout with an ambiguous rev

From
RSRohit Sarkar <rohitsarkar5398@gmail.com>
Date
Oct 2, 2019, 12:02 UTC
Message-ID
<20191002120213.GB5812@SARKAR>

Hi, I was looking into writing a patch for the issue [1] where if an user has multiple remotes each with a remote tracking branch of the same name say xyz, 'git checkout xyz' fails with "error: pathspec 'xyz' did not match any file(s) known to git."

This can sort of be handled by setting checkout.defaultRemote so that the ambiguity is removed. Although when checkout.defaultRemote is not set or there are more than 2 remotes I think it would be helpful if git gives a message listing out the possible revs instead of the pathspec error. What do you guys think?

[1] : https://public-inbox.org/git/CACcTrKdzVCKUR8EfwhqBQR7vWzRqTLcwRJ_r-hx3VztD=xvNuQ@mail.gmail.com/
Next: Rohit Sarkar
Message 1 of 2 in “git checkout with an ambiguous rev”
  1. Rohit SarkarOct 2, 2019
  2. Rohit SarkarOct 2, 2019

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.