* Short rant about git usability - make 'git clone' work on an empty remote repository
@ 2009-01-22 10:02 Richard W.M. Jones
2009-01-22 11:01 ` Mikael Magnusson
2009-01-22 13:00 ` Sverre Rabbelier
0 siblings, 2 replies; 4+ messages in thread
From: Richard W.M. Jones @ 2009-01-22 10:02 UTC (permalink / raw)
To: git
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.
$ git status
# On branch master
nothing to commit (working directory clean)
$ 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'
$ man git-push
$ git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me either. Please
name which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details on the refspec.
If you often merge with the same branch, you may want to
configure the following variables in your configuration
file:
branch.master.remote = <nickname>
branch.master.merge = <remote-ref>
remote.<nickname>.url = <url>
remote.<nickname>.fetch = <refspec>
See git-config(1) for details.
Arrggghhhh, just MAKE GIT CLONE WORK!!!
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://et.redhat.com/~rjones/virt-df/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Short rant about git usability - make 'git clone' work on an empty remote repository
2009-01-22 10:02 Short rant about git usability - make 'git clone' work on an empty remote repository Richard W.M. Jones
@ 2009-01-22 11:01 ` Mikael Magnusson
2009-01-22 13:00 ` Sverre Rabbelier
1 sibling, 0 replies; 4+ messages in thread
From: Mikael Magnusson @ 2009-01-22 11:01 UTC (permalink / raw)
To: Richard W.M. Jones; +Cc: git
2009/1/22 Richard W.M. Jones <rjones@redhat.com>:
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Short rant about git usability - make 'git clone' work on an empty remote repository
2009-01-22 10:02 Short rant about git usability - make 'git clone' work on an empty remote repository Richard W.M. Jones
2009-01-22 11:01 ` Mikael Magnusson
@ 2009-01-22 13:00 ` Sverre Rabbelier
2009-01-22 13:51 ` Johannes Schindelin
1 sibling, 1 reply; 4+ messages in thread
From: Sverre Rabbelier @ 2009-01-22 13:00 UTC (permalink / raw)
To: Richard W.M. Jones; +Cc: git
Heya,
On Thu, Jan 22, 2009 at 11:02, Richard W.M. Jones <rjones@redhat.com> wrote:
> $ 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
> $ mkdir ocaml-autoconf
> $ cd ocaml-autoconf
> $ git init
> Initialized empty Git repository in /home/rjones/d/ocaml-autoconf/.git/
> $ git remote add origin git+ssh://rwmj@git.ocamlcore.org/gitroot/ocaml-autoconf/ocaml-autoconf.git
> $ echo test > README
> $ git add README
> $ git commit
> Created initial commit 2c9a63a: Create repository.
> 1 files changed, 1 insertions(+), 0 deletions(-)
> create mode 100644 README
> $ git push origin master
Is, as far as I can see, the minimal you could have done to get your
remote set up. You are right in that cloning an empty repository would
be nice to have as it would save having to remember to do about 8
different commands. Then again, after digging through the source for
half an hour I'm still not sure I even understand what's going on, let
alone know how to fix it ;). You should ask on #git for cloning empty
dir support, maybe it'll annoy Dscho enough to fix it.
--
Cheers,
Sverre Rabbelier
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-22 13:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-22 10:02 Short rant about git usability - make 'git clone' work on an empty remote repository Richard W.M. Jones
2009-01-22 11:01 ` Mikael Magnusson
2009-01-22 13:00 ` Sverre Rabbelier
2009-01-22 13:51 ` Johannes Schindelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).