Bug 315015 - Create new (bare) git repository
Summary: Create new (bare) git repository
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 0.9.0-M3   Edit
Assignee: Mathias Kinzler CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2010-05-30 16:09 EDT by Lars Vogel CLA
Modified: 2010-11-23 06:19 EST (History)
6 users (show)

See Also:


Attachments
Layout issues with dialog (46.77 KB, image/png)
2010-08-24 11:08 EDT, Chris Aniszczyk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2010-05-30 16:09:00 EDT
It would be nice if EGit supports the creation of new (bare) repositories similar to the following:

git clone --bare . ../remote-repository.git
Comment 1 Mathias Kinzler CLA 2010-08-23 09:40:47 EDT
Code review at http://egit.eclipse.org/r/#change,1375
Comment 2 Chris Aniszczyk CLA 2010-08-24 11:08:53 EDT
Created attachment 177327 [details]
Layout issues with dialog

The directory text is taking up too much space...
Comment 3 Chris Aniszczyk CLA 2010-08-24 11:10:04 EDT
Another thing to note is that we now have three wizards on essentially adding / creating a repository... in the future, we may look to simplify this all in one wizard or dialog...
Comment 4 Chris Aniszczyk CLA 2010-08-24 11:32:05 EDT
Fixed with 3a26f7e5b4b91de152d9e2777bef2883ccf9bc6f.

Thanks Mathias!
Comment 5 Tomasz Zarna CLA 2010-11-22 13:32:56 EST
Forgive my ignorance, but isn't the committed change an equivalent of "git init --bare ../remote-repository.git" rather than "git clone --bare . ../remote-repository.git" as requested in comment 0?

I've been looking for a way to clone a repo and make it bare using JGit/EGit API. Unfortunately, it appears that org.eclipse.egit.core.op.CloneOperation can be used only to clone non-bare repos:
* no param when doing local.create() in doInit
* setting "bare" to false in local config few lines below
* and finally checking out the work dir in doCheckout

Lars is that really what you wanted? If yes I guess I will need to open a separate bug for it.
Comment 6 Lars Vogel CLA 2010-11-22 16:23:18 EST
git init --bare ../remote-repository.git was my intention. I suggest to open a new bug.
Comment 7 Chris Aniszczyk CLA 2010-11-22 16:27:12 EST
(In reply to comment #5)
> Forgive my ignorance, but isn't the committed change an equivalent of "git init
> --bare ../remote-repository.git" rather than "git clone --bare .
> ../remote-repository.git" as requested in comment 0?
> 
> I've been looking for a way to clone a repo and make it bare using JGit/EGit
> API. Unfortunately, it appears that org.eclipse.egit.core.op.CloneOperation can
> be used only to clone non-bare repos:
> * no param when doing local.create() in doInit
> * setting "bare" to false in local config few lines below
> * and finally checking out the work dir in doCheckout

You should be using JGit API.
   http://wiki.eclipse.org/JGit/User_Guide#Repository

Create a repository, you can set the bare attribute on the RepositoryBuilder class. There is a CheckoutCommand in the 'org.eclipse.jgit.api' package in the latest nightly build. If you wait a few days, there will be a 'CloneCommand' available too... just takes time.
Comment 8 Tomasz Zarna CLA 2010-11-23 06:19:00 EST
(In reply to comment #6)
> I suggest to open a new bug.
Sure, it's bug 330898.