tags:

views:

125

answers:

1

I have a remote machine RemoteMachine which hold the clone of another MachineWeNotConcern with:

git clone MachineWeNotConcern/prj prj

My local machine clone like this:

git clone RemoteMachine/prj local_prj

Now I want to make the RemoteMachine's repos to bare(how?) as if I checked with:

git clone --bare MachineWeNotConcern/prj prj

And I don't want to re-clone from my bare repos of the RemoteMachine because it always takes to much time.

How can I achieve this?

+4  A: 

You could make a new clone from your local repo on the remote machine of the project with --bare. ie:

git clone --bare prj bare_prj

Then delete the original prj. This would be faster than cloning it from the original machine again.

EDIT: Another solution:

It looks like you could make your repo into a bare repo by:

  • changing the .git/config file to have bare = true instead of bare = false
  • removing the contents of prj/* other than the .git file
  • moving the .git dir contents into prj/ and removing the .git dir

At least, this seems to work for me, but there could be reasons this would fail, for all I know.

Jesse Rusak