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

fatal: options '--bare' and '--origin foo' cannot be used together

From
JLJohn A. Leuenhagen <john@zlima12.com>
Date
Sep 21, 2022, 19:23 UTC
Message-ID
<20220921192333.yasrvnisccuk3ivg@Lima-X2>
Hi all,

I often like to change the name of the remote that I clone repositories from, as "origin" is too generic for me when I have more than one remote.

Usually, I only remember after I clone, and wind up doing `git remote rename origin foo`. I'd like to get in the habit of instead doing `git clone -o foo https://link.to/foo.git`. However, when I tried doing this with --bare, I got the error that I've made the subject of this email. Why can't I do this?

When I try to do `git remote rename origin foo` in the bare repository (cloned without -o foo), I get a different error:

>fatal: could not unset 'remote.foo.fetch'

However, `git config remote.foo.fetch` indicates that this value is not set.

Why does this behavior differ from the equivalent commands on a non-bare repository?

-- 
John
Next: Jeff King
Message 1 of 11 in “fatal: options '--bare' and '--origin foo' cannot be used together”
  1. John A. LeuenhagenSep 21, 2022
  2. Jeff KingSep 22, 2022
  3. Jeff KingSep 22, 2022
  4. 1/2 clone: allow "--bare" with "-o"Jeff King, Sep 22, 2022
  5. Eric SunshineSep 22, 2022
  6. Jeff KingSep 22, 2022
  7. Eric SunshineSep 22, 2022
  8. Jeff KingSep 22, 2022
  9. Eric SunshineSep 22, 2022
  10. Jeff KingSep 22, 2022
  11. 2/2 remote: handle rename of remote without fetch refspecJeff King, Sep 22, 2022

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.