git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PROBLEM] Checkout from cloned repository does not work

From
Junio C Hamano <junkio@cox.net>
Date
Sep 2, 2005, 18:13 UTC
Message-ID
<7vpsrrgwxb.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<84144f0205090204201f74e425@mail.gmail.com>
Pekka Enberg <penberg@cs.helsinki.fi> writes:
> I cannot checkout from a cloned git repository I have created. I am
> using git 0.99.5 from Gentoo portage.
Show 6 quoted lines
> Following the tutorial, I create new git repository:
>...
> Now on the server, I create a repository:
>
>   $ mkdir git-test.git
>   GIT_DIR=git-test.git/ git-init-db

You would need 'chmod +x git-test.git/hooks/post-update' here if you are allowing people to pull over http from this repository.

I just realized that where this was documented was quite obscure in the tutorial. I'll update it with the appended patch.

Show 7 quoted lines
> 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:

The problem is that 'git clone' does not support cloning over http from servers that are not properly prepared. This 'git clone' exited with non-zero status with an error message, didn't it?

-->8-- -->8-- -->8-- Mention post-update when we first talk about publishing a repository.

There is more detailed instruction for `project lead` later in the tutorial to talk about the same, but at this point in the flow of tutorial, the first time reader has no way of knowing it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -1103,6 +1103,12 @@ your login shell is `bash`, only `.bashr
 `.bash_profile`. As a workaround, make sure `.bashrc` sets up
 `$PATH` so that you can run `git-receive-pack` program.
 
+[NOTE]
+If you plan to publish this repository to be accessed over http,
+you should do `chmod +x my-git.git/hooks/post-update` at this
+point.  This makes sure that every time you push into this
+repository, `git-update-server-info` is run.
+
 Your "public repository" is now ready to accept your changes.
 Come back to the machine you have your private repository. From
 there, run this command:
Previous: Pekka EnbergNext: Pekka Enberg
Message 2 of 5 in “[PROBLEM] Checkout from cloned repository does not work”
  1. Pekka EnbergSep 2, 2005
  2. Junio C HamanoSep 2, 2005
  3. Pekka EnbergSep 3, 2005
  4. Junio C HamanoSep 3, 2005
  5. Pekka EnbergSep 3, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.