Git development
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Thomas Glanzmann <thomas@glanzmann.de>
Cc: GIT <git@vger.kernel.org>
Subject: Re: Publishing Question: First time Pushing to nonexsiting directory
Date: Mon, 19 Feb 2007 03:10:10 -0500	[thread overview]
Message-ID: <20070219081010.GC30030@spearce.org> (raw)
In-Reply-To: <20070219073526.GA26531@cip.informatik.uni-erlangen.de>

Thomas Glanzmann <thomas@glanzmann.de> wrote:
> I thought that there is a command available which I can use to push a
> repository to a remote nonexisting location (that gets created on the
> fly) like in the following scenario:
> 
>         - Create a git project on my laptop
>         - Check in a few files
>         - Publish the git repository to 
> 
>         (thinkpad) [~/work/astro-tg] git push 131.188.30.59:/home/cip/adm/sithglan/work/repositories/private/astro/
>         fatal: '/home/cip/adm/sithglan/work/repositories/private/astro': unable to chdir or not a git archive
>         fatal: The remote end hung up unexpectedly
> 
> I thought that I read a comment from Linus(?) long time ago to how to obtain
> that. But I am unable to find the e-mail in my archives. If there is no
> standard way, how do you do it? Just rsync the files and change the
> 'origin'?

SSH into the remote system that you want to push to, then run
init-db there:

  $ ssh 131.188.30.59 git --git-dir=/home/cip/adm/sithglan/work/repositories/private/astro.git init-db

Configure that as a remote, e.g. origin:

  $ git remote add origin 131.188.30.59:/home/cip/adm/sithglan/work/repositories/private/astro.git

Now push to there:

  $ git push origin master:master

And maybe fetch back to create the tracking branches:

  $ git fetch


Note that in my examples above I added ".git" to the end of the
repository path, as this is rather typical for a 'bare repository'
(that is, a repository without a working directory attached).
You usually don't want to push into a repository with a working
directory, but it is supported and a lot of folks do it.

I also assumed Git 1.5.0 on your thinkpad end, as git-remote was
recently added in that version.  Handy tool.  :)

-- 
Shawn.

  reply	other threads:[~2007-02-19  8:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-19  7:35 Publishing Question: First time Pushing to nonexsiting directory Thomas Glanzmann
2007-02-19  8:10 ` Shawn O. Pearce [this message]
2007-02-19 19:44   ` Thomas Glanzmann
2007-02-19 20:03     ` Shawn O. Pearce
2007-02-19 20:10       ` Thomas Glanzmann
2007-02-19  8:33 ` Junio C Hamano

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=20070219081010.GC30030@spearce.org \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=thomas@glanzmann.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox