git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: Jeff Brown <jeff@jeffandbetsy.net>
Cc: git@vger.kernel.org
Subject: Re: committing to a checked out branch
Date: Tue, 19 May 2009 11:21:52 -0400	[thread overview]
Message-ID: <76718490905190821p1776905bn53610c0e8acd0113@mail.gmail.com> (raw)
In-Reply-To: <bbd12f0f0905190809k3dc13c3ak170535a5c0eed9b9@mail.gmail.com>

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.)

j.

  reply	other threads:[~2009-05-19 15:22 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 [this message]
2009-05-19 17:01       ` Jeff Brown

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=76718490905190821p1776905bn53610c0e8acd0113@mail.gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jeff@jeffandbetsy.net \
    /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).