Some issues working with empty/bare repositories...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux