<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>EGit User Guide - Tasks</title>
<link type="text/css" rel="stylesheet" href="../../book.css"/>
</head>
<body>
<table class="navigation" style="width: 100%;" border="0" summary="navigation">
<tr>
<th style="width: 100%" align="center" colspan="3">Tasks</th>
</tr>
<tr>
<td style="width: 20%" align="left">
<a href="Concepts.html" title="Concepts">
<img alt="Previous" border="0" src="../../images/prev.gif"/>
</a>
</td>
<td style="width: 60%" align="center"></td>
<td style="width: 20%" align="right">
<a href="Reference.html" title="Reference">
<img alt="Next" border="0" src="../../images/next.gif"/>
</a>
</td>
</tr>
<tr>
<td style="width: 20%" align="left" valign="top">Concepts</td>
<td style="width: 60%" align="center"></td>
<td style="width: 20%" align="right" valign="top">Reference</td>
</tr>
</table><hr/>
<h1 id="Tasks">Tasks</h1>
<h2 id="Creating_Repositories">Creating Repositories</h2>
<h3 id="Considerations_for_Git_Repositories_to_be_used_in_Eclipse">Considerations for Git Repositories to be used in Eclipse</h3>
<h4 id="The_short_story">The short story</h4>
<p>When setting up Git Repositories with EGit, there are two recommendations for the creation of "productive" (as opposed for "playground") Repositories:</p>
<ul>
<li>Don't create the Repository within the Eclipse workspace
<ul>
<li>Be careful when cloning or creating a Repository</li>
<li>Make sure to use the Git Sharing Wizard correctly</li>
</ul>
</li>
<li>Don't create a Repository with an Eclipse project as root
<ul>
<li>Make sure to use the Git Sharing Wizard correctly</li>
</ul>
</li>
</ul>
<p>The first one happens when you specify a workspace folder during cloning or creation of a Repository.</p>
<p>Both of the above will happen when you use the Git Sharing Wizard from an Eclipse project that you have created manually in your workspace without taking precautions (the wizard has been fixed in the latest version).</p>
<p>Below you will find some motivation for these recommendations.</p>
<h4 id="The_longer_story">The longer story</h4>
<h5 id="Eclipse_Workspace_and_Repository_working_directory">Eclipse Workspace and Repository working directory</h5>
<p>Git Repositories can be created in different ways, for example by cloning from an existing Repository, by creating one from scratch, or by using the EGit Sharing wizard.</p>
<p>In any case (unless you create a "bare" Repository, but that's not discussed here), the new Repository is essentially a folder on the local hard disk which contains the "working directory" and the metadata folder. The metadata folder is a dedicated child folder named ".git" and often referred to as ".git-folder". It contains the actual repository (i.e. the Commits, the References, the logs and such).</p>
<p>The metadata folder is totally transparent to the Git client, while the working directory is used to expose the currently checked out Repository content as files for tools and editors.</p>
<p>Typically, if these files are to be used in Eclipse, they must be imported into the Eclipse workspace in one way or another. In order to do so, the easiest way would be to check in .project files from which the "Import Existing Projects" wizard can create the projects easily. Thus in most cases, the structure of a Repository containing Eclipse projects would look similar to something like this:</p>
<p>
<img border="0" src="images/EGit-0.12-SetupRepo-RepoStructureTwoProjects.jpg"/>
</p>
<h5 id="Implications">Implications</h5>
<p>The above has the following implications:</p>
<ul>
<li>It is probably not a good idea to make a project the root folder of your Repository</li>
</ul>
<dl>
<dd>The reason is that you will never be able to add another project to this Repository, as the .project file will occupy the root folder; you could still add projects as sub-folders, but this kind of project nesting is known to cause lots of problems all over the place. In order to add another project, you would have to move the project to a sub-folder in the Repository and add the second project as another sub-folder before you could commit this change.</dd>
</dl>
<ul>
<li>It is a good idea to keep your Repository outside of your Eclipse Workspace</li>
</ul>
<dl>
<dd>There are several reasons for this:</dd>
</dl>
<dl>
<dd>The new Repository will consider the complete folder structure of the Eclipse workspace as (potential) content. This can result in performance issues, for example when calculating the changes before committing (which will scan the complete .metadata folder, for example); more often than not, the workspace will contain dead folders (e.g. deleted projects) which semantically are not relevant for EGit but can not be excluded easily.</dd>
</dl>
<dl>
<dd>The metadata (.git-) folder will be a child of the Eclipse Workspace. It is unclear whether this might cause unwanted folder traversals by Eclipse.</dd>
</dl>
<dl>
<dd>You can easily destroy your Repository by destroying your Eclipse Workspace</dd>
</dl>
<h3 id="Creating_a_new_empty_Git_Repository">Creating a new empty Git Repository</h3>
<p>You can create a project first and share it afterwards. The Share Project Wizard supports creation of Git repositories (see
<a href="http://wiki.eclipse.org/EGit/User_Guide/Sharing#Adding_a_project_to_version_control" title="EGit/User Guide/Sharing#Adding_a_project_to_version_control" target="egit_external">Adding a project to version control</a>).
</p>
<p>You can also create a new empty Git Repository from the Git Repositories View (see
<a href="Creating_a_Repository" title="EGit/User_Guide#Creating_a_Repository">Creating a Repository</a>).
</p>
<h3 id="Creating_a_Git_Repository_for_multiple_Projects">Creating a Git Repository for multiple Projects</h3>
<p>You may first create multiple projects under a common directory and then create a common repository for all projects in one go:</p>
<ul>
<li>create the Eclipse projects e.g. a, b, c under a common directory e.g. <span style="font-family:monospace;">/repos/examples/</span></li>
<li>select all projects a, b, c - from context menu click
<b>Team > Share Project > Git</b>
</li>
<li>press
<b>Next</b>
</li>
<li>select all projects a, b, c</li>
<li>the wizard automatically moves up the default repository location to the parent folder <span style="font-family:monospace;">/repos/examples/</span> since multiple projects have been selected</li>
<li>click
<b>Create Repository</b> and
<b>Finish</b>
</li>
</ul>
<p>
<br/>
</p>
<h2 id="Starting_from_existing_Git_Repositories">Starting from existing Git Repositories</h2>
<p>In order to work with the content of a Git repository in the Eclipse workbench, the contained files and folders must be imported as projects. In principle, this import can be done using the generic "New Project" or "Import..." wizards, since the working directory of a Git Repository is just a normal directory in the local file system. However, the newly created projects would still have to be shared manually with Git. The "Import Projects from Git" wizards integrates project import and sharing and also offers some extra convenience.</p>
<h3 id="Starting_the_import_wizard">Starting the import wizard</h3>
<p>To start the wizard click
<b>Import > Git > Projects from Git</b>
</p>
<p>If you started in a clean workspace, the first page will display an empty list:</p>
<p>
<img border="0" src="images/Egit-0.9-import-projects-selec
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
JFrame可以做出类似于QQ登录功能的窗体,通过JFrame可以利用Java代码实现窗体功能,一般用于CS项目的C(客户端)的开发; 利用JFrame可以自己写java代码,也可以通过在eclipse中安装windowbuilder插件,这样可以利用windowbuilder插件对窗体进行可视化的快速创建、操作等,快速实现编程的开发; 但是,许多初学者下载的eclipse工具是没有windowbuilder插件,并且集成该插件后eclipse不能正常工作,会出现闪退情况。 资源中的版本是成功整合了windowbuilder插件的eclipse版本。下载后直接解压就可以使用,无需安装和另外安装插件。 你也可以很轻松就能上手和使用这个版本的eclipse。
资源推荐
资源详情
资源评论













收起资源包目录





































































































共 4980 条
- 1
- 2
- 3
- 4
- 5
- 6
- 50
资源评论


小码哥Lvan
- 粉丝: 1221
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- geekai-Go资源
- Admin.NET-C#资源
- MDword-PHP资源
- mybatis-mate-examples-SQL资源
- 计算机二级习题-计算机二级资源
- 医院感染三级网络建设及应用.ppt
- 电子科技16春《网络互连与路由技术》在线作业2.doc
- Graduation Project Client-毕业设计资源
- 基于STC12C5A16S2单片机的PWM电机调速系统.doc
- 数据库原理课程设计-毕业设计-超市物流管理系统.doc
- matlab语音识别系统(源代码).doc
- 计算机多媒体技术在提高中职数学教学有效性中的作用分析.docx
- 计算机辅助工程分析.docx
- 操作系统硕士研究生入学考试模拟试题参考答案(电子).doc
- PLC四层电梯自动控制系统课程设计分析方案-欧姆龙-武汉工程大学版.doc
- (2025)土建质检员考试题库及答案.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
