git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: committing to a checked out branch

From
Jeff Brown <jeff@jeffandbetsy.net>
Date
May 19, 2009, 17:01 UTC
Message-ID
<bbd12f0f0905191001iad76a64id648780547b43b34@mail.gmail.com>
In-Reply-To
<76718490905190821p1776905bn53610c0e8acd0113@mail.gmail.com>
On Tue, May 19, 2009 at 10:21 AM, Jay Soffian <jaysoffian@gmail.com> wrote:
Show 17 quoted lines
> 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/
Previous: Jay Soffian
Message 5 of 5 in “committing to a checked out branch”
  1. Jeff BrownMay 19, 2009
  2. Jay SoffianMay 19, 2009
  3. Jeff BrownMay 19, 2009
  4. Jay SoffianMay 19, 2009
  5. Jeff BrownMay 19, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.