All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: git@vger.kernel.org
Subject: [PROBLEM] Checkout from cloned repository does not work
Date: Fri, 2 Sep 2005 14:20:32 +0300	[thread overview]
Message-ID: <84144f0205090204201f74e425@mail.gmail.com> (raw)

Hi,

I cannot checkout from a cloned git repository I have created. I am
using git 0.99.5 from Gentoo portage.

Following the tutorial, I create new git repository:

  $ mkdir git-test
  $ cd git-test/
  $ git-init-db
  defaulting to local storage area
  $ echo "Hello, Git" > hello
  $ git-update-cache --add hello
  $ git-write-tree
  4bd2134df7a908d2764f70d155e32650954cfc72
  $ echo "Initial commit" | git-commit-tree
4bd2134df7a908d2764f70d155e32650954cfc72 > .git/HEAD
  Committing initial tree 4bd2134df7a908d2764f70d155e32650954cfc72

Now on the server, I create a repository:

  $ mkdir git-test.git
  GIT_DIR=git-test.git/ git-init-db

Then I push my local repository to remote server like this:

  $ git push ssh.remote.server:/home/penberg/public_html/git-test.git master
  Password:
  updating 'refs/heads/master'
    from 0000000000000000000000000000000000000000
    to   8744316e49411509ba28e9cf567f3aec5833ec74
  Packing 3 objects
  Unpacking 3 objects
   100% (3/3) done
  refs/heads/master: 0000000000000000000000000000000000000000 ->
8744316e49411509ba28e9cf567f3aec5833ec74

After which I clone the newly created repository like this:

  $ git clone http://www.remote.server/~penberg/git-test.git cloned
  defaulting to local storage area
  Somebody should define smarter http server protocol

Now, the problem is that checkout does not work:

  $ git checkout
  usage: git-read-tree (<sha> | -m [-u] <sha1> [<sha2> [<sha3>]])

That's because I have no HEAD:

  $ ls -l .git/HEAD
  lrwxrwxrwx  1 penberg users 17 Sep  2 14:07 .git/HEAD -> refs/heads/master

  $ ls -l .git/refs/heads/
  total 0

What am I doing wrong here? Doing a git pull causes the following error:

  $ git pull http://www.remote.server/~penberg/git-test.git
  Fetching HEAD from http://www.remote.server/~penberg/git-test.git using http
  got 8744316e49411509ba28e9cf567f3aec5833ec74
  got 4bd2134df7a908d2764f70d155e32650954cfc72
  got b7aec520dec0a7516c18eb4c68b64ae1eb9b5a5e
  * committish: 8744316e49411509ba28e9cf567f3aec5833ec74  HEAD from
http://www.remote.server/~penberg/git-test.git
  cat: .git/HEAD: No such file or directory
  fatal: Needed a single revision
  git-resolve-script <head> <remote> <merge-message>

                                       Pekka

             reply	other threads:[~2005-09-02 11:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-02 11:20 Pekka Enberg [this message]
2005-09-02 18:13 ` [PROBLEM] Checkout from cloned repository does not work Junio C Hamano
2005-09-03  6:49   ` Pekka Enberg
2005-09-03  7:31     ` Junio C Hamano
2005-09-03  7:43       ` Pekka Enberg

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=84144f0205090204201f74e425@mail.gmail.com \
    --to=penberg@cs.helsinki.fi \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.