This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 267632 - Git clone can't create NetBeans project in desired directory
Summary: Git clone can't create NetBeans project in desired directory
Status: NEW
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal with 2 votes (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-18 15:34 UTC by mclaborn
Modified: 2017-03-17 20:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (173.50 KB, text/plain)
2016-08-18 15:34 UTC, mclaborn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mclaborn 2016-08-18 15:34:35 UTC
Product Version = NetBeans IDE Dev (Build 201608150002)
Operating System = Linux version 4.4.0-34-generic running on amd64
Java; VM; Vendor = 1.8.0_102
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.102-b14

Reproducibility: Happens every time

Not sure if this should be classified as a bug or an enhancement request. 

What I'm trying to do seems simple enough: create a brand new NetBeans project that is cloned from a remote git repository (bare). Neither the git clone command nor the new Net Beans project wizard will work on a non-empty directory, so it seems to be a bit of a chicken-and-egg situation.

As a workaround I created the NB project, then did the "git clone" into a temporary folder and moved the .git folder into my NB project folder. That seems to work, but surely there is a better way? 

I tried using the git clone dialog. At the end it offers the option to create a NB project if one was not found in the cloned sources. This approach works, except that the new project dialog creates the project folder underneath the cloned directory, rather than as the cloned directory. 

Example:

I clone the GitTest repository to ~/projects/GitTest. So far so good.

The new project dialog wants to create the NB project folder as ~/projects/GitTest/GitTest.  I don't want or need that extra level of directory.  I want the NB project folder to be ~/projects/GitTest. If I try to make the project folder be ~/projects/GitTest, it complains: "Project folder already exists and is not empty."
Comment 1 mclaborn 2016-08-18 15:34:39 UTC
Created attachment 161707 [details]
IDE log
Comment 2 Ondrej Vrabec 2016-08-18 16:11:43 UTC
You can't clone into an existing folder, that's Git limitation to prevent from overwriting data.

Why don't you do it the opposite way?
* Create local project
* Git -> Initialize (to create git repo in the project's folder)
* Git -> Remote -> Push... and set up the connection in wizard.
Comment 3 fxb 2017-03-17 20:20:44 UTC
(In reply to Ondrej Vrabec from comment #2)
> You can't clone into an existing folder, that's Git limitation to prevent
> from overwriting data.
> 
> Why don't you do it the opposite way?
> * Create local project
> * Git -> Initialize (to create git repo in the project's folder)
> * Git -> Remote -> Push... and set up the connection in wizard.

Cloning works as expected and creates the folder structure correctly to mirror the git repository and the folder structure on the computer that pushed it to the repository in the first place. The problem is when Netbeans tries to create a project out of the cloned files. It does not allow to create the project in the folder corresponding to the project folder on the other computer, saying "Project Folder already exists and is not empty."

Am I missing something here?