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

Re: Short rant about git usability - make 'git clone' work on an empty remote repository

From
MMMikael Magnusson <mikachu@gmail.com>
Date
Jan 22, 2009, 11:01 UTC
Message-ID
<237967ef0901220301p47dab7d7hdbf2dccd04a99f16@mail.gmail.com>
In-Reply-To
<20090122100230.GA9653@amd.home.annexia.org>
2009/1/22 Richard W.M. Jones <rjones@redhat.com>:
Show 80 quoted lines
> This is a rant, those offended by rants should stop reading now.
>
> When I want to check out a remote repository, I do:
>
>  git clone URL...
>
> Except when the repository is empty, when for no explicable reason
> this familiar command doesn't work.
>
>  $ git clone git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git
>  Initialized empty Git repository in /home/rjones/d/ocaml-autoconf/.git/
>  fatal: no matching remote head
>
>  $ git init ocaml-autoconf
>  usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]]
>  $ mkdir ocaml-autoconf
>  $ cd ocaml-autoconf
>  $ git init
>  Initialized empty Git repository in /home/rjones/d/ocaml-autoconf/.git/
>  $ ls
>  $ ls -a
>  .  ..  .git
>
> Following advice on a website ...
>
>  $ git-remote origin git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git
>  error: Unknown subcommand: origin
>  usage: git remote
>     or: git remote add <name> <url>
>     or: git remote rm <name>
>     or: git remote show <name>
>     or: git remote prune <name>
>     or: git remote update [group]
>
>      -v, --verbose         be verbose
>
>  $ git remote add origin git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git
>
>  $ git status
>  # On branch master
>  #
>  # Initial commit
>  #
>  nothing to commit (create/copy files and use "git add" to track)
>  $ git branch
>  $ git checkout
>  fatal: You are on a branch yet to be born
>  $ git status
>  # On branch master
>  #
>  # Initial commit
>  #
>  nothing to commit (create/copy files and use "git add" to track)
>  $ echo test > README
>  $ git commit -a
>  # On branch master
>  #
>  # Initial commit
>  #
>  # Untracked files:
>  #   (use "git add <file>..." to include in what will be committed)
>  #
>  #     README
>  nothing added to commit but untracked files present (use "git add" to track)
>  $ git add README
>  $ git commit -a
>  Created initial commit 2c9a63a: Create repository.
>   1 files changed, 1 insertions(+), 0 deletions(-)
>   create mode 100644 README
>
>  $ git push
>  No refs in common and none specified; doing nothing.
>  Perhaps you should specify a branch such as 'master'.
>  fatal: The remote end hung up unexpectedly
>  error: failed to push some refs to 'git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git'
>  $ git push master
>  fatal: 'master': unable to chdir or not a git archive
>  fatal: The remote end hung up unexpectedly
>  $ git branch master
>  fatal: A branch named 'master' already exists.

$ man git-push $ git push origin master

Previous: Richard W.M. JonesNext: Sverre Rabbelier
Message 2 of 4 in “Short rant about git usability - make 'git clone' work on an empty remote repository”
  1. Richard W.M. JonesJan 22, 2009
  2. Mikael MagnussonJan 22, 2009
  3. Sverre RabbelierJan 22, 2009
  4. Johannes SchindelinJan 22, 2009

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.