[英]How do I add existing eclipse java project to git
How do I add an existing java project in eclipse to git? 如何在eclipse中添加现有的java项目到git?
I noticed when creating the project there was an option to add to source control but I can't find this option for an existing project. 我注意到在创建项目时有一个添加到源代码管理的选项,但我找不到现有项目的这个选项。 Is this possible from the git plugin in eclipse or must it be done from the command line?
这可能来自eclipse中的git插件还是必须从命令行完成? (I am using a Mac)
(我使用的是Mac)
Follow these steps 跟着这些步骤
Team
-> Share
Team
- > Share
Create
-> Browse
if you already have one Create
- >“ Browse
An alternative route (I have found the built-in Eclipse tool to be finicky at times): 另一种方法(我发现内置的Eclipse工具有时很挑剔):
git init
to create a repository git init
以创建存储库 git add --all
to add all your files to the repository (Note: if you skip this step, you will have an empty repository. You can also use git add filename
to add only specific files/folders) git add --all
将所有文件添加到存储库(注意:如果跳过此步骤,您将拥有一个空存储库。您还可以使用git add filename
仅添加特定git add filename
文件/文件夹) git commit -m "your message here"
to perform your first commit git commit -m "your message here"
以执行您的第一次提交 At this point, you have a brand new local repository containing your files! 此时,您有一个包含文件的全新本地存储库! The following steps will hook it up to a remote repository.
以下步骤将它连接到远程存储库。
New
button, and follow the prompts. New
按钮,然后按照提示操作即可。 your-repository-name.git
your-repository-name.git
结尾的HTTPS链接 git remote add origin
into your terminal, followed by that HTTPS link git remote add origin
到终端,然后是HTTPS链接 git push -u origin master
into your terminal (Note: these last two steps are shown on the GitHub new project page as well, for easy copy-and-pasting into your terminal) git push -u origin master
粘贴到终端中(注意:最后两个步骤也显示在GitHub新项目页面上,以便于复制和粘贴到终端中) Now you have a local repository connected to a remote repository, ready to use! 现在您有一个连接到远程存储库的本地存储库,随时可以使用! All Eclipse projects exist somewhere in your file system, and can easily be accessed just like any other folder you might want to turn into a repository.
所有Eclipse项目都存在于文件系统中的某个位置,并且可以像您可能想要转换为存储库的任何其他文件夹一样轻松访问。
I do realize you asked to avoid the command line, but this is a relatively simple command line task, and learning to be somewhat familiar with how to use your command line can pay big dividends later on. 我确实意识到你要求避免使用命令行,但这是一个相对简单的命令行任务,学习如何熟悉如何使用命令行可以在以后支付大笔红利。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.