git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* fatal: options '--bare' and '--origin foo' cannot be used together
@ 2022-09-21 19:23 John A. Leuenhagen
  2022-09-22  4:55 ` Jeff King
  0 siblings, 1 reply; 11+ messages in thread
From: John A. Leuenhagen @ 2022-09-21 19:23 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-09-22  6:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21 19:23 fatal: options '--bare' and '--origin foo' cannot be used together John A. Leuenhagen
2022-09-22  4:55 ` Jeff King
2022-09-22  5:31   ` Jeff King
2022-09-22  5:32     ` [PATCH 1/2] clone: allow "--bare" with "-o" Jeff King
2022-09-22  5:58       ` Eric Sunshine
2022-09-22  6:18         ` Jeff King
2022-09-22  6:26           ` Eric Sunshine
2022-09-22  6:35             ` Jeff King
2022-09-22  6:40               ` Eric Sunshine
2022-09-22  6:26           ` Jeff King
2022-09-22  5:33     ` [PATCH 2/2] remote: handle rename of remote without fetch refspec Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).