git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dirk Süsserott" <newsletter@dirk.my1.cc>
To: Graeme Geldenhuys <graemeg@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Correct way of making existing remote repository "bare"
Date: Wed, 15 Jul 2009 16:12:42 +0200	[thread overview]
Message-ID: <4A5DE3DA.1010004@dirk.my1.cc> (raw)
In-Reply-To: <h3khis$3tq$1@ger.gmane.org>

Am 15.07.2009 14:20 schrieb Graeme Geldenhuys:
> Hi,
> 
> Yesterday I initialized a new repository on our server. I did some 
> coding locally, added the remote server (git remote add ....) and then 
> pushed my changes to the remote server.
> 
> But I noticed that my remote server is not a "bare" repository and git 
> complains when I push to it again. What is the correct way to make an 
> existing remote repository bare?
> 
> This is what I did and it worked, but not sure if this is the correct 
> way of doing it.
> 
> Steps I done:
> 
> * ssh to remote server
> * git clone --bare -l <path_to_repos> <new_dir>
> * renamed old repository directory
> * renamed new repository dir to what old repository used to be.
> 
> Like I said, this did the tick, but is this the correct way of doing it?
> 
> 
> Regards,
>   - Graeme -
> 

Sounds like that's the correct way. I sometimes faced the same problem 
and was lazy:

$ ssh to the remote && cd repo
$ rm everything except for the .git directory (make sure everything is 
committed before doing this)
$ mv .git/* . && rmdir .git # i.e.move the .git contents one level up
$ edit config
change 'core.bare=false' to 'core.bare=true' (or add a similar line)

done.

I think what you did is 'porcellain' while my solution is 'plumbing'.
Any complaints?

     Dirk

  parent reply	other threads:[~2009-07-15 14:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-15 12:20 Correct way of making existing remote repository "bare" Graeme Geldenhuys
2009-07-15 14:08 ` Johannes Schindelin
2009-07-15 14:21   ` Dirk Süsserott
2009-07-15 14:44   ` Graeme Geldenhuys
2009-07-16  7:59   ` Eric Raible
2009-07-15 14:12 ` Dirk Süsserott [this message]
2009-07-15 19:39   ` 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=4A5DE3DA.1010004@dirk.my1.cc \
    --to=newsletter@dirk.my1.cc \
    --cc=git@vger.kernel.org \
    --cc=graemeg@gmail.com \
    /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).