From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Git Mailing List <git@vger.kernel.org>
Subject: Recovering from 'fatal: core.bare and core.worktree do not make sense'
Date: Wed, 27 May 2015 12:31:47 +0200 [thread overview]
Message-ID: <20150527123147.Horde.GqzoX-7JvXiOGBlB5moP4A8@webmail.informatik.kit.edu> (raw)
Hi,
the other day I said 'git config core.worktree /somewhere' in a bare
repo while thinking I was in a regular one, user error. The 'fatal:
core.bare and core.worktree do not make sense' error from the next
command made me realize immediately that I was wrong, that's good.
However...
OK, let's have a look and recover from the situation:
$ git config --edit
fatal: core.bare and core.worktree do not make sense
Well, all was well before I set 'core.worktree', so let's unset it:
$ git config --unset core.worktree
fatal: core.bare and core.worktree do not make sense
Hmph, not expecting much, but how about unsetting the other
variable?
$ git config --unset core.bare
fatal: core.bare and core.worktree do not make sense
Good, at least it's pretty consistent, though I still don't get what
'git config' has to do with the worktree that is so important that
it has to bail out. Time to look for help:
$ git help config
fatal: core.bare and core.worktree do not make sense
WTF :)
Alright, I give up:
$ vim config
$ # happy
It was two days later that I had a bit of a lightbulb moment,
reproduced the situation and just for fun tried this:
$ git -c core.bare=false config --unset core.bare
I didn't expect, but it worked! Great.
Some thoughts:
1) Perhaps 'git config' should be more careful in the first place
and refuse to set 'core.worktree' when 'core.bare' is already
true and vice versa.
2) The damage was done with 'git config', so I expected that I can
repair it with "plain" 'git config' (i.e. without 'git -c') as
well. 'git config' has nothing to do with the path to the
worktree after all. And 'git config --edit' should work
regardless of the mess that might be in the config file.
3) 'git help <cmd>' should always work, shouldn't it? (Though
that's the easiest to remedy, just cd out of the repo, or fire
up a new terminal window.)
Gábor
next reply other threads:[~2015-05-27 10:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-27 10:31 SZEDER Gábor [this message]
2015-05-29 6:49 ` [PATCH] setup_git_directory: delay core.bare/core.worktree errors Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150527123147.Horde.GqzoX-7JvXiOGBlB5moP4A8@webmail.informatik.kit.edu \
--to=szeder@ira.uka.de \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).