{"thread":{"id":"17301","subject":"Short rant about git usability - make 'git clone' work on an empty remote repository","startedAt":"2009-01-22T10:02:30Z","lastAt":"2009-01-22T13:51:27Z","messageCount":4,"participants":["Richard W.M. Jones","Mikael Magnusson","Sverre Rabbelier","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"101516","messageId":"20090122100230.GA9653@amd.home.annexia.org","threadId":"17301","inReplyTo":null,"subject":"Short rant about git usability - make 'git clone' work on an empty remote repository","fromName":"Richard W.M. Jones","fromEmail":"rjones@redhat.com","sentAt":"2009-01-22T10:02:30Z","receivedAt":"2009-01-22T10:02:30Z","isPatch":false,"sender":{"key":"rjones@redhat.com","avatar":"https://gravatar.com/avatar/6bc2ebbc861c9a4776b76939247a95d742d150e3feb2878a3b1ffd4d950329db?d=mp&s=160"},"body":"This is a rant, those offended by rants should stop reading now.\n\nWhen I want to check out a remote repository, I do:\n\n  git clone URL...\n\nExcept when the repository is empty, when for no explicable reason\nthis familiar command doesn't work.\n\n  $ git clone git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git\n  Initialized empty Git repository in /home/rjones/d/ocaml-autoconf/.git/\n  fatal: no matching remote head\n\n  $ git init ocaml-autoconf\n  usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]]\n  $ mkdir ocaml-autoconf\n  $ cd ocaml-autoconf\n  $ git init\n  Initialized empty Git repository in /home/rjones/d/ocaml-autoconf/.git/\n  $ ls\n  $ ls -a\n  .  ..  .git\n\nFollowing advice on a website ...\n\n  $ git-remote origin git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git\n  error: Unknown subcommand: origin\n  usage: git remote\n     or: git remote add <name> <url>\n     or: git remote rm <name>\n     or: git remote show <name>\n     or: git remote prune <name>\n     or: git remote update [group]\n\n      -v, --verbose         be verbose\n\n  $ git remote add origin git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git\n\n  $ git status\n  # On branch master\n  #\n  # Initial commit\n  #\n  nothing to commit (create/copy files and use \"git add\" to track)\n  $ git branch\n  $ git checkout\n  fatal: You are on a branch yet to be born\n  $ git status\n  # On branch master\n  #\n  # Initial commit\n  #\n  nothing to commit (create/copy files and use \"git add\" to track)\n  $ echo test > README\n  $ git commit -a\n  # On branch master\n  #\n  # Initial commit\n  #\n  # Untracked files:\n  #   (use \"git add <file>...\" to include in what will be committed)\n  #\n  #\tREADME\n  nothing added to commit but untracked files present (use \"git add\" to track)\n  $ git add README\n  $ git commit -a\n  Created initial commit 2c9a63a: Create repository.\n   1 files changed, 1 insertions(+), 0 deletions(-)\n   create mode 100644 README\n\n  $ git push\n  No refs in common and none specified; doing nothing.\n  Perhaps you should specify a branch such as 'master'.\n  fatal: The remote end hung up unexpectedly\n  error: failed to push some refs to 'git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git'\n  $ git push master\n  fatal: 'master': unable to chdir or not a git archive\n  fatal: The remote end hung up unexpectedly\n  $ git branch master\n  fatal: A branch named 'master' already exists.\n  $ git status\n  # On branch master\n  nothing to commit (working directory clean)\n  $ git push\n  No refs in common and none specified; doing nothing.\n  Perhaps you should specify a branch such as 'master'.\n  fatal: The remote end hung up unexpectedly\n  error: failed to push some refs to 'git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git'\n  $ man git-push\n  $ git pull\n  You asked me to pull without telling me which branch you\n  want to merge with, and 'branch.master.merge' in\n  your configuration file does not tell me either.  Please\n  name which branch you want to merge on the command line and\n  try again (e.g. 'git pull <repository> <refspec>').\n  See git-pull(1) for details on the refspec.\n  \n  If you often merge with the same branch, you may want to\n  configure the following variables in your configuration\n  file:\n  \n      branch.master.remote = <nickname>\n      branch.master.merge = <remote-ref>\n      remote.<nickname>.url = <url>\n      remote.<nickname>.fetch = <refspec>\n  \n  See git-config(1) for details.\n\nArrggghhhh, just MAKE GIT CLONE WORK!!!\n\nRich.\n\n-- \nRichard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones\nvirt-df lists disk usage of guests without needing to install any\nsoftware inside the virtual machine.  Supports Linux and Windows.\nhttp://et.redhat.com/~rjones/virt-df/\n"},{"id":"101521","messageId":"237967ef0901220301p47dab7d7hdbf2dccd04a99f16@mail.gmail.com","threadId":"17301","inReplyTo":"20090122100230.GA9653@amd.home.annexia.org","subject":"Re: Short rant about git usability - make 'git clone' work on an empty remote repository","fromName":"Mikael Magnusson","fromEmail":"mikachu@gmail.com","sentAt":"2009-01-22T11:01:12Z","receivedAt":"2009-01-22T11:01:12Z","isPatch":false,"sender":{"key":"mikachu@gmail.com","avatar":null},"body":"2009/1/22 Richard W.M. Jones <rjones@redhat.com>:\n> This is a rant, those offended by rants should stop reading now.\n>\n> When I want to check out a remote repository, I do:\n>\n>  git clone URL...\n>\n> Except when the repository is empty, when for no explicable reason\n> this familiar command doesn't work.\n>\n>  $ git clone git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git\n>  Initialized empty Git repository in /home/rjones/d/ocaml-autoconf/.git/\n>  fatal: no matching remote head\n>\n>  $ git init ocaml-autoconf\n>  usage: git init [-q | --quiet] [--bare] [--template=<template-directory>] [--shared[=<permissions>]]\n>  $ mkdir ocaml-autoconf\n>  $ cd ocaml-autoconf\n>  $ git init\n>  Initialized empty Git repository in /home/rjones/d/ocaml-autoconf/.git/\n>  $ ls\n>  $ ls -a\n>  .  ..  .git\n>\n> Following advice on a website ...\n>\n>  $ git-remote origin git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git\n>  error: Unknown subcommand: origin\n>  usage: git remote\n>     or: git remote add <name> <url>\n>     or: git remote rm <name>\n>     or: git remote show <name>\n>     or: git remote prune <name>\n>     or: git remote update [group]\n>\n>      -v, --verbose         be verbose\n>\n>  $ git remote add origin git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git\n>\n>  $ git status\n>  # On branch master\n>  #\n>  # Initial commit\n>  #\n>  nothing to commit (create/copy files and use \"git add\" to track)\n>  $ git branch\n>  $ git checkout\n>  fatal: You are on a branch yet to be born\n>  $ git status\n>  # On branch master\n>  #\n>  # Initial commit\n>  #\n>  nothing to commit (create/copy files and use \"git add\" to track)\n>  $ echo test > README\n>  $ git commit -a\n>  # On branch master\n>  #\n>  # Initial commit\n>  #\n>  # Untracked files:\n>  #   (use \"git add <file>...\" to include in what will be committed)\n>  #\n>  #     README\n>  nothing added to commit but untracked files present (use \"git add\" to track)\n>  $ git add README\n>  $ git commit -a\n>  Created initial commit 2c9a63a: Create repository.\n>   1 files changed, 1 insertions(+), 0 deletions(-)\n>   create mode 100644 README\n>\n>  $ git push\n>  No refs in common and none specified; doing nothing.\n>  Perhaps you should specify a branch such as 'master'.\n>  fatal: The remote end hung up unexpectedly\n>  error: failed to push some refs to 'git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git'\n>  $ git push master\n>  fatal: 'master': unable to chdir or not a git archive\n>  fatal: The remote end hung up unexpectedly\n>  $ git branch master\n>  fatal: A branch named 'master' already exists.\n\n$ man git-push\n$ git push origin master\n"},{"id":"101526","messageId":"bd6139dc0901220500q7bb91031o81c3aab41c68d518@mail.gmail.com","threadId":"17301","inReplyTo":"20090122100230.GA9653@amd.home.annexia.org","subject":"Re: Short rant about git usability - make 'git clone' work on an empty remote repository","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-01-22T13:00:55Z","receivedAt":"2009-01-22T13:00:55Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Thu, Jan 22, 2009 at 11:02, Richard W.M. Jones <rjones@redhat.com> wrote:\n>  $ git clone git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git\n>  Initialized empty Git repository in /home/rjones/d/ocaml-autoconf/.git/\n>  fatal: no matching remote head\n>  $ mkdir ocaml-autoconf\n>  $ cd ocaml-autoconf\n>  $ git init\n>  Initialized empty Git repository in /home/rjones/d/ocaml-autoconf/.git/\n>  $ git remote add origin git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git\n>  $ echo test > README\n>  $ git add README\n>  $ git commit\n>  Created initial commit 2c9a63a: Create repository.\n>   1 files changed, 1 insertions(+), 0 deletions(-)\n>   create mode 100644 README\n>  $ git push origin master\n\nIs, as far as I can see, the minimal you could have done to get your\nremote set up. You are right in that cloning an empty repository would\nbe nice to have as it would save having to remember to do about 8\ndifferent commands. Then again, after digging through the source for\nhalf an hour I'm still not sure I even understand what's going on, let\nalone know how to fix it ;). You should ask on #git for cloning empty\ndir support, maybe it'll annoy Dscho enough to fix it.\n\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"101527","messageId":"alpine.DEB.1.00.0901221451100.3586@pacific.mpi-cbg.de","threadId":"17301","inReplyTo":"bd6139dc0901220500q7bb91031o81c3aab41c68d518@mail.gmail.com","subject":"Re: Short rant about git usability - make 'git clone' work on an empty remote repository","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-01-22T13:51:27Z","receivedAt":"2009-01-22T13:51:27Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 22 Jan 2009, Sverre Rabbelier wrote:\n\n> You should ask on #git for cloning empty dir support, maybe it'll annoy \n> Dscho enough to fix it.\n\nBastard :-)\n\nCiao,\nDscho\n"}]}