From: "Reece Dunn" <msclrhd@googlemail.com>
To: Git <git@vger.kernel.org>
Subject: Some issues working with empty/bare repositories...
Date: Sat, 1 Mar 2008 19:40:39 +0000 [thread overview]
Message-ID: <3f4fd2640803011140o38ba0830l7775c8528f812779@mail.gmail.com> (raw)
Hi,
Some git operations -- only tried clone and log -- require a
repository to contain at least one commit.
$ git --version
git version 1.5.3.1
While this is fine when working with existing projects, it can be
confusing/problematic when setting up a new repository.
Consider the following workflow:
$ mkdir foo
$ cd foo
$ git --bare init
$ git log
fatal: bad default revision 'HEAD'
This message is confusing for a newbie. Displaying "no commits" would
make more sense here.
$ cat HEAD
ref: refs/heads/master
$ find refs/heads/master
find: refs/heads/master: No such file or directory
If the user wants to use the bare repository as the main location of
the project, but make changes to it elsewhere (e.g. when setting up a
superproject for adding submodules to), they might want to do
something like:
$ git clone foo bar
Initialized empty Git repository in /home/reece/bar/.git/
$ ls -a /home/reece
. .. foo
It appears from the git output (with the inconsistently capitalized
git - see --version output above) that the clone succeeded, but it
does not create bar/.git/, even though it said that it did.
- Reece
next reply other threads:[~2008-03-01 19:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-01 19:40 Reece Dunn [this message]
2008-03-03 8:10 ` Some issues working with empty/bare repositories Jeff King
2008-03-04 21:51 ` Reece Dunn
2008-03-05 1:07 ` [RFC] improve 'bad default revision' message for empty repo Jeff King
2008-03-05 2:43 ` Junio C Hamano
2008-03-05 4:33 ` Jeff King
2008-03-05 8:48 ` Junio C Hamano
2008-03-05 9:10 ` Jeff King
2008-03-05 9:25 ` 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=3f4fd2640803011140o38ba0830l7775c8528f812779@mail.gmail.com \
--to=msclrhd@googlemail.com \
--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).