git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Brown <jeff@jeffandbetsy.net>
To: git@vger.kernel.org
Subject: Re: committing to a checked out branch
Date: Tue, 19 May 2009 12:01:00 -0500	[thread overview]
Message-ID: <bbd12f0f0905191001iad76a64id648780547b43b34@mail.gmail.com> (raw)
In-Reply-To: <76718490905190821p1776905bn53610c0e8acd0113@mail.gmail.com>

On Tue, May 19, 2009 at 10:21 AM, Jay Soffian <jaysoffian@gmail.com> wrote:
> On Tue, May 19, 2009 at 11:09 AM, Jeff Brown <jeff@jeffandbetsy.net> wrote:
>> When I create a new repo on my server I have been creating an empty
>> directory, then git init, then git add some file and commit.  I expect
>> that is the long/wrong way to initialize a repo, especially if I want
>> it to be bare.  What is the best approach to creating a cloneable bare
>> repo?
>
> server$ mkdir /path/to/newrepo.git
> server$ cd /path/to/newrepo.git && git init --bare
> laptop$ git clone ssh://server/path/to/newrepo.git
> laptop$ cd newrepo
> laptop$ # add; commit; add; commit; ...
> laptop$ git push origin master
>
> (This may only work with recent versions of git as I believe earlier
> versions used to complain about cloning an empty repository.)
>

git init --bare

That is the bit I needed.

Thanks again!



jb

-- 
Jeff Brown
SpringSource
http://www.springsource.com/

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

      reply	other threads:[~2009-05-19 17:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19  0:33 committing to a checked out branch Jeff Brown
2009-05-19  2:17 ` Jay Soffian
2009-05-19 15:09   ` Jeff Brown
2009-05-19 15:21     ` Jay Soffian
2009-05-19 17:01       ` Jeff Brown [this message]

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=bbd12f0f0905191001iad76a64id648780547b43b34@mail.gmail.com \
    --to=jeff@jeffandbetsy.net \
    --cc=git@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).