如何使用 Eclipse EGit 从 GIT 存储库创建新项目

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9192125/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 12:55:59  来源:igfitidea点击:

How to create new project from GIT repo using Eclipse EGit

eclipsegitegit

提问by ddinchev

I have added a new GIT repo (private github repo) to Eclipse EGit repo explorer. In the working directory, our team has many projects - some python, some C++, some PHP - they are in different sub-directories. I choose a dir with python project and from the context menu I select "Import" then complete the steps with "New Project Wizard". I choose new "PyDev" project and end up with new project that is empty - only Eclipse files like the .project inside.

我在 Eclipse EGit 存储库资源管理器中添加了一个新的 GIT 存储库(私有 github 存储库)。在工作目录中,我们团队有很多项目——一些是python,一些C++,一些PHP——它们在不同的子目录中。我选择一个带有 python 项目的目录,然后从上下文菜单中选择“导入”,然后使用“新建项目向导”完成这些步骤。我选择了新的“PyDev”项目,最终得到了一个空的新项目——只有 Eclipse 文件,比如里面的 .project。

I want to create a new python project with the contents of ~/git/repo - I don't want external other copy of the tree.

我想用 ~/git/repo 的内容创建一个新的 python 项目 - 我不想要树的外部其他副本。

采纳答案by VonC

You could follow this tutorial, and share your project.

您可以按照本教程,并分享您的项目。

Create Egit repo

创建 Egit 仓库

That would create a local Git repo, to which you can add your private GitHub repo as a remote.
See also "Pushing a Local Repository to GitHub ".

这将创建一个本地 Git 存储库,您可以将私有 GitHub 存储库作为远程添加到其中。
另请参阅“将本地存储库推送到 GitHub”。

Select your new Eclipse project and click "Team" > "Push To"and enter "Your GitHub Clone URL"and your GitHub password (with the free GitHub accounts, do not enter a password but leave blank), leave the user as "git"

选择您的新 Eclipse 项目并单击"Team" > "Push To"并输入"Your GitHub Clone URL"您的 GitHub 密码(使用免费的 GitHub 帐户,不要输入密码而是留空),将用户保留为“git”

push to GitHub repo

推送到 GitHub 仓库