如何从现有的 git 存储库创建 Netbeans 7 项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5801446/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to create a Netbeans 7 project from an existing git repo?
提问by Ollie Glass
I'd imagine there is a 'new project from repo' option somewhere but I can't find it. Is there more to it than this, or am I missing something?
我想在某处有一个“来自 repo 的新项目”选项,但我找不到它。还有比这更多的东西吗,还是我错过了什么?
采纳答案by KingCrunch
Just clone the repo into your (newly created) netbeans project and then refresh (build) it.
只需将 repo 克隆到您的(新创建的)netbeans 项目中,然后刷新(构建)它。
回答by Terence Johnson
Use the Teammenu, select "Git" > "Clone..."
使用团队菜单,选择“Git”>“克隆...”
Once the repo has been cloned into a local folder, NetBeans will give you the option to open the project.
将存储库克隆到本地文件夹后,NetBeans 将为您提供打开项目的选项。
Trying to create a project and then clone into it fails because the target folder is not completely empty.
尝试创建一个项目然后克隆到其中失败,因为目标文件夹不是完全空的。
回答by Octopus
Here's what worked for me:
以下是对我有用的内容:
> git clone https://github.com/path/project
Then in NetBeans: File > New Project > choose a project type "...with Existing Sources" > "Next" select "Source Folder" (the folder you cloned into) and press "Finish"
然后在 NetBeans 中:文件 > 新建项目 > 选择项目类型“...使用现有源”>“下一步”选择“源文件夹”(您克隆到的文件夹)并按“完成”
Unfortunately, it seems that your project must already correspond to a project type that NetBeans already supports (eg. Java Application, HTML5/JS Application, etc). If it doesn't you probably won't get this to work.
不幸的是,您的项目似乎必须已经对应于 NetBeans 已经支持的项目类型(例如 Java 应用程序、HTML5/JS 应用程序等)。如果不是,你可能不会得到它的工作。
回答by awgold90
But if you want to use a local git repository(i.e. a repo that was alredy cloned from the git server e.g. by Eclipse) in Netbeans withoutcloning it from the server, you have to click on Team --> Git --> Clone and in the input field "Repository URL" type file:///D:/your.local.git.repo/. In the field "Clone into:" you have to specify the destination folder of the cloning.
但是,如果您想在 Netbeans 中使用本地 git 存储库(即已经从 git 服务器例如通过 Eclipse 克隆的存储库)而不从服务器克隆它,您必须单击 Team --> Git --> Clone 和在输入字段“存储库 URL”中输入file:///D:/your.local.git.repo/。在“克隆到:”字段中,您必须指定克隆的目标文件夹。
This will "make a copy" of D:/your.local.git.repo/into the destination folder.