You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2015/01/07 16:11:05 UTC

[GIT] Getting started with Git and Eclipse

I've just started trying to look at some Math code with Eclipse.

However it's not at all obvious how to create the initial project.

I'm used to SVN where there is a list of SVN repos, and one can just
checkout the required tree.

How is one supposed to add the initial project to Eclipse?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [GIT] Getting started with Git and Eclipse

Posted by Benedikt Ritter <br...@apache.org>.
2015-01-07 21:05 GMT+01:00 sebb <se...@gmail.com>:

> On 7 January 2015 at 17:57, Christopher <ct...@apache.org> wrote:
> > On Wed, Jan 7, 2015 at 12:47 PM, sebb <se...@gmail.com> wrote:
> >
> >> On 7 January 2015 at 17:39, Christopher <ct...@apache.org> wrote:
> >> > On Wed, Jan 7, 2015 at 10:11 AM, sebb <se...@gmail.com> wrote:
> >> >
> >> >> I've just started trying to look at some Math code with Eclipse.
> >> >>
> >> >> However it's not at all obvious how to create the initial project.
> >> >>
> >> >> I'm used to SVN where there is a list of SVN repos, and one can just
> >> >> checkout the required tree.
> >> >>
> >> >> How is one supposed to add the initial project to Eclipse?
> >> >>
> >> >
> >> > I just do:
> >> >
> >> > git clone https://git-wip-us.apache.org/repos/asf/commons-math
> >>
> >> Just tried that:
> >>
> >> Cloning into 'commons-math'...
> >> warning: templates not found /usr/local/git/share/git-core/templates
> >> fatal: Unable to find remote helper for 'https'
> >>
> >> I'm on MacOSX.
> >>
> >>
> > Sorry, can't help with that. It worked fine for me on OSX 10.8.5 and git
> > 2.1.0 (installed with homebrew).
> > A quick Google search revealed some issue with curl, maybe?
>
> Turns out the issue was I was using Git from Source tree.app.
> It's probably not intended for standalone use.
>
> In case it helps anyone else, I just installed the command line git 2.2.1
> from
>
> http://sourceforge.net/projects/git-osx-installer/files/


I recommend using Homebrew for installing command line utiilities:
http://brew.sh/


>
>
> Then ran the following to replace the Xcode (Apple) git that was
> earlier in the path
>
> sudo mv /usr/bin/git /usr/bin/git-xcode
> sudo ln -sf /usr/local/git/bin/git /usr/bin/git
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Re: [GIT] Getting started with Git and Eclipse

Posted by sebb <se...@gmail.com>.
On 7 January 2015 at 17:57, Christopher <ct...@apache.org> wrote:
> On Wed, Jan 7, 2015 at 12:47 PM, sebb <se...@gmail.com> wrote:
>
>> On 7 January 2015 at 17:39, Christopher <ct...@apache.org> wrote:
>> > On Wed, Jan 7, 2015 at 10:11 AM, sebb <se...@gmail.com> wrote:
>> >
>> >> I've just started trying to look at some Math code with Eclipse.
>> >>
>> >> However it's not at all obvious how to create the initial project.
>> >>
>> >> I'm used to SVN where there is a list of SVN repos, and one can just
>> >> checkout the required tree.
>> >>
>> >> How is one supposed to add the initial project to Eclipse?
>> >>
>> >
>> > I just do:
>> >
>> > git clone https://git-wip-us.apache.org/repos/asf/commons-math
>>
>> Just tried that:
>>
>> Cloning into 'commons-math'...
>> warning: templates not found /usr/local/git/share/git-core/templates
>> fatal: Unable to find remote helper for 'https'
>>
>> I'm on MacOSX.
>>
>>
> Sorry, can't help with that. It worked fine for me on OSX 10.8.5 and git
> 2.1.0 (installed with homebrew).
> A quick Google search revealed some issue with curl, maybe?

Turns out the issue was I was using Git from Source tree.app.
It's probably not intended for standalone use.

In case it helps anyone else, I just installed the command line git 2.2.1 from

http://sourceforge.net/projects/git-osx-installer/files/

Then ran the following to replace the Xcode (Apple) git that was
earlier in the path

sudo mv /usr/bin/git /usr/bin/git-xcode
sudo ln -sf /usr/local/git/bin/git /usr/bin/git

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [GIT] Getting started with Git and Eclipse

Posted by Christopher <ct...@apache.org>.
On Wed, Jan 7, 2015 at 12:47 PM, sebb <se...@gmail.com> wrote:

> On 7 January 2015 at 17:39, Christopher <ct...@apache.org> wrote:
> > On Wed, Jan 7, 2015 at 10:11 AM, sebb <se...@gmail.com> wrote:
> >
> >> I've just started trying to look at some Math code with Eclipse.
> >>
> >> However it's not at all obvious how to create the initial project.
> >>
> >> I'm used to SVN where there is a list of SVN repos, and one can just
> >> checkout the required tree.
> >>
> >> How is one supposed to add the initial project to Eclipse?
> >>
> >
> > I just do:
> >
> > git clone https://git-wip-us.apache.org/repos/asf/commons-math
>
> Just tried that:
>
> Cloning into 'commons-math'...
> warning: templates not found /usr/local/git/share/git-core/templates
> fatal: Unable to find remote helper for 'https'
>
> I'm on MacOSX.
>
>
Sorry, can't help with that. It worked fine for me on OSX 10.8.5 and git
2.1.0 (installed with homebrew).
A quick Google search revealed some issue with curl, maybe?

Re: [GIT] Getting started with Git and Eclipse

Posted by sebb <se...@gmail.com>.
On 7 January 2015 at 17:39, Christopher <ct...@apache.org> wrote:
> On Wed, Jan 7, 2015 at 10:11 AM, sebb <se...@gmail.com> wrote:
>
>> I've just started trying to look at some Math code with Eclipse.
>>
>> However it's not at all obvious how to create the initial project.
>>
>> I'm used to SVN where there is a list of SVN repos, and one can just
>> checkout the required tree.
>>
>> How is one supposed to add the initial project to Eclipse?
>>
>
> I just do:
>
> git clone https://git-wip-us.apache.org/repos/asf/commons-math

Just tried that:

Cloning into 'commons-math'...
warning: templates not found /usr/local/git/share/git-core/templates
fatal: Unable to find remote helper for 'https'

I'm on MacOSX.

>
> Then, in Eclipse, File -> Import -> Existing Maven Projects.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [GIT] Getting started with Git and Eclipse

Posted by Christopher <ct...@apache.org>.
On Wed, Jan 7, 2015 at 10:11 AM, sebb <se...@gmail.com> wrote:

> I've just started trying to look at some Math code with Eclipse.
>
> However it's not at all obvious how to create the initial project.
>
> I'm used to SVN where there is a list of SVN repos, and one can just
> checkout the required tree.
>
> How is one supposed to add the initial project to Eclipse?
>

I just do:

git clone https://git-wip-us.apache.org/repos/asf/commons-math

Then, in Eclipse, File -> Import -> Existing Maven Projects.

Re: [GIT] Getting started with Git and Eclipse

Posted by James Carman <ja...@carmanconsulting.com>.
Isn't this a question for the Eclipse people?

On Wed, Jan 7, 2015 at 10:11 AM, sebb <se...@gmail.com> wrote:
> I've just started trying to look at some Math code with Eclipse.
>
> However it's not at all obvious how to create the initial project.
>
> I'm used to SVN where there is a list of SVN repos, and one can just
> checkout the required tree.
>
> How is one supposed to add the initial project to Eclipse?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [GIT] Getting started with Git and Eclipse

Posted by James Carman <ja...@carmanconsulting.com>.
Isn't that a bit of a slippery slope?  Do we want to have a wiki page
for OSX tips and tricks too?  Do we need a separate one for IDEA, or
Netbeans, or VI?  The project is using Git and Maven.  I don't know
that you can get any more common than that in the Java ecosystem these
days.  There are plenty of resources for folks to rely upon.  We don't
need to hold their hands.

On Wed, Jan 7, 2015 at 12:26 PM, sebb <se...@gmail.com> wrote:
> On 7 January 2015 at 17:14, Bernd Eckenfels <ec...@zusammenkunft.net> wrote:
>> Am Wed, 7 Jan 2015 16:42:56 +0000
>> schrieb sebb <se...@gmail.com>:
>>
>>> On 7 January 2015 at 16:06, luc <lu...@spaceroots.org> wrote:
>>> > Hi Sebb,
>>> >
>>> > Le 2015-01-07 16:11, sebb a écrit :
>>> >
>>> >> I've just started trying to look at some Math code with Eclipse.
>>> >>
>>> >> However it's not at all obvious how to create the initial project.
>>> >>
>>> >> I'm used to SVN where there is a list of SVN repos, and one can
>>> >> just checkout the required tree.
>>> >>
>>> >> How is one supposed to add the initial project to Eclipse?
>>> >
>>> >
>>> > You are right. It is not obvious.
>>> >
>>> > You should select File -> import... and from the popup wizard find
>>> > the Git-> Projects from Git.
>>>
>>> OK, that works, but there seems to be no way to create the project in
>>> the same workspace as the other Commons components.
>>
>> Actually there are multiple ways. The Eclipse integration of Git
>> somewhat asumes you want to have a shared Git Repo location independent
>> of the workspace. This has the advantage that all workspaces share the
>> same local Git repository. However I prefer the more traditional
>> approach with .git containing the repo.
>>
>> So my prefered way is to use the command line tools to check out a
>> repo. This not only has the advantage that I can use cut+paste of the
>> checkout command, but it also will use the .git location and I can
>> directly create it in the WS directory. After that you "import existing
>> maven project".
>>
>> You can also use the repository view in Eclipse:
>> "Show View -> "Git Repositories". Here you can paste a repository path,
>> it normally asumes a shared repository directory as well, but you
>> change the "directory" setting to the would-be project location in the
>> workspace. (ie. \ws\commons-math instead of USER\git\commons-math).
>> This even allows to import in one step.
>>
>> Having the repo view open is helpful anyway, so this could be the best
>> way (unless you prefer like me the command line for initial checkouts).
>
> Maybe this should be added to the Wiki page that Luc started?
> Or a related page - it may be better to document the initial setup
> steps separately.
>
>> Gruss
>> Bernd
>>
>>> > You can look here:
>>> > <http://www.vogella.com/tutorials/EclipseGit/article.html#clone_respository>.
>>> >
>>> > I'll add it to the wiki.
>>>
>>> Thanks.
>>>
>>> > best regards,
>>> > Luc
>>> >
>>> >
>>> >
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> >> For additional commands, e-mail: dev-help@commons.apache.org
>>> >
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> > For additional commands, e-mail: dev-help@commons.apache.org
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [GIT] Getting started with Git and Eclipse

Posted by sebb <se...@gmail.com>.
On 7 January 2015 at 17:14, Bernd Eckenfels <ec...@zusammenkunft.net> wrote:
> Am Wed, 7 Jan 2015 16:42:56 +0000
> schrieb sebb <se...@gmail.com>:
>
>> On 7 January 2015 at 16:06, luc <lu...@spaceroots.org> wrote:
>> > Hi Sebb,
>> >
>> > Le 2015-01-07 16:11, sebb a écrit :
>> >
>> >> I've just started trying to look at some Math code with Eclipse.
>> >>
>> >> However it's not at all obvious how to create the initial project.
>> >>
>> >> I'm used to SVN where there is a list of SVN repos, and one can
>> >> just checkout the required tree.
>> >>
>> >> How is one supposed to add the initial project to Eclipse?
>> >
>> >
>> > You are right. It is not obvious.
>> >
>> > You should select File -> import... and from the popup wizard find
>> > the Git-> Projects from Git.
>>
>> OK, that works, but there seems to be no way to create the project in
>> the same workspace as the other Commons components.
>
> Actually there are multiple ways. The Eclipse integration of Git
> somewhat asumes you want to have a shared Git Repo location independent
> of the workspace. This has the advantage that all workspaces share the
> same local Git repository. However I prefer the more traditional
> approach with .git containing the repo.
>
> So my prefered way is to use the command line tools to check out a
> repo. This not only has the advantage that I can use cut+paste of the
> checkout command, but it also will use the .git location and I can
> directly create it in the WS directory. After that you "import existing
> maven project".
>
> You can also use the repository view in Eclipse:
> "Show View -> "Git Repositories". Here you can paste a repository path,
> it normally asumes a shared repository directory as well, but you
> change the "directory" setting to the would-be project location in the
> workspace. (ie. \ws\commons-math instead of USER\git\commons-math).
> This even allows to import in one step.
>
> Having the repo view open is helpful anyway, so this could be the best
> way (unless you prefer like me the command line for initial checkouts).

Maybe this should be added to the Wiki page that Luc started?
Or a related page - it may be better to document the initial setup
steps separately.

> Gruss
> Bernd
>
>> > You can look here:
>> > <http://www.vogella.com/tutorials/EclipseGit/article.html#clone_respository>.
>> >
>> > I'll add it to the wiki.
>>
>> Thanks.
>>
>> > best regards,
>> > Luc
>> >
>> >
>> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> >> For additional commands, e-mail: dev-help@commons.apache.org
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> > For additional commands, e-mail: dev-help@commons.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [GIT] Getting started with Git and Eclipse

Posted by Bernd Eckenfels <ec...@zusammenkunft.net>.
Am Wed, 7 Jan 2015 16:42:56 +0000
schrieb sebb <se...@gmail.com>:

> On 7 January 2015 at 16:06, luc <lu...@spaceroots.org> wrote:
> > Hi Sebb,
> >
> > Le 2015-01-07 16:11, sebb a écrit :
> >
> >> I've just started trying to look at some Math code with Eclipse.
> >>
> >> However it's not at all obvious how to create the initial project.
> >>
> >> I'm used to SVN where there is a list of SVN repos, and one can
> >> just checkout the required tree.
> >>
> >> How is one supposed to add the initial project to Eclipse?
> >
> >
> > You are right. It is not obvious.
> >
> > You should select File -> import... and from the popup wizard find
> > the Git-> Projects from Git.
> 
> OK, that works, but there seems to be no way to create the project in
> the same workspace as the other Commons components.

Actually there are multiple ways. The Eclipse integration of Git
somewhat asumes you want to have a shared Git Repo location independent
of the workspace. This has the advantage that all workspaces share the
same local Git repository. However I prefer the more traditional
approach with .git containing the repo.

So my prefered way is to use the command line tools to check out a
repo. This not only has the advantage that I can use cut+paste of the
checkout command, but it also will use the .git location and I can
directly create it in the WS directory. After that you "import existing
maven project".

You can also use the repository view in Eclipse:
"Show View -> "Git Repositories". Here you can paste a repository path,
it normally asumes a shared repository directory as well, but you
change the "directory" setting to the would-be project location in the
workspace. (ie. \ws\commons-math instead of USER\git\commons-math).
This even allows to import in one step.

Having the repo view open is helpful anyway, so this could be the best
way (unless you prefer like me the command line for initial checkouts).

Gruss
Bernd

> > You can look here:
> > <http://www.vogella.com/tutorials/EclipseGit/article.html#clone_respository>.
> >
> > I'll add it to the wiki.
> 
> Thanks.
> 
> > best regards,
> > Luc
> >
> >
> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >> For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [GIT] Getting started with Git and Eclipse

Posted by sebb <se...@gmail.com>.
On 7 January 2015 at 16:06, luc <lu...@spaceroots.org> wrote:
> Hi Sebb,
>
> Le 2015-01-07 16:11, sebb a écrit :
>
>> I've just started trying to look at some Math code with Eclipse.
>>
>> However it's not at all obvious how to create the initial project.
>>
>> I'm used to SVN where there is a list of SVN repos, and one can just
>> checkout the required tree.
>>
>> How is one supposed to add the initial project to Eclipse?
>
>
> You are right. It is not obvious.
>
> You should select File -> import... and from the popup wizard find
> the Git-> Projects from Git.

OK, that works, but there seems to be no way to create the project in
the same workspace as the other Commons components.

> You can look here:
> <http://www.vogella.com/tutorials/EclipseGit/article.html#clone_respository>.
>
> I'll add it to the wiki.

Thanks.

> best regards,
> Luc
>
>
>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [GIT] Getting started with Git and Eclipse

Posted by luc <lu...@spaceroots.org>.
Hi Sebb,

Le 2015-01-07 16:11, sebb a écrit :
> I've just started trying to look at some Math code with Eclipse.
> 
> However it's not at all obvious how to create the initial project.
> 
> I'm used to SVN where there is a list of SVN repos, and one can just
> checkout the required tree.
> 
> How is one supposed to add the initial project to Eclipse?

You are right. It is not obvious.

You should select File -> import... and from the popup wizard find
the Git-> Projects from Git. You can look here: 
<http://www.vogella.com/tutorials/EclipseGit/article.html#clone_respository>.

I'll add it to the wiki.

best regards,
Luc


> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org