EGit User Guide | ||
---|---|---|
![]() |
||
Concepts |
If you're new to Git or distributed version control systems generally, then you might want to read Git for Eclipse Users first. If you need more details and background read the Git Community Book or Git Pro.
Whenever the history of the repository is changed (technically, whenever a commit is created), Git keeps track of the user who created that commit. The identification consists of a name (typically a person's name) and an e-mail address. This information is stored in file ~/.gitconfig
under dedicated keys.
EGit will ask you for this information when you create your first commit. By default, this dialog is shown only once until you create a new workspace or tick the checkbox "Show initial configuration dialog" on the Git Preference page:
You can also untick "Don't show this dialog again" if you want to see it again later.
Instead of using this dialog, you can always change this information using the Git configuration:
user.email
and user.name
Add the environment variable HOME
to your environment variables.
EGit needs this path for looking up the user configuration (.gitconfig). HOME
should point to your home directory e.g. C:\Users\Tom
.
Ensure correct case! E.g. C:\users
instead of C:\Users
may cause problems!
If the HOME
variable is not defined the home directory will be calculated by concatenating HOMEDRIVE
and HOMEPATH
.
If both HOME
and HOMEDRIVE
are not defined HOMESHARE
will be used.
EGit shows a warning if HOME
is not defined explicitly. Keep in mind that if you set the HOME environment variable while Eclipse is running, you will still see following warning. You will have to restart Eclipse for it to recognize the HOME value.
HelloWorld
HelloWorld
HelloWorld
project. If your project already resides in the working tree of an exisiting Git repository the repository is chosen automatically.
.classpath
and .project
and the .settings
files are not yet under version control
.gitignore
in the project folder with the following content
/bin
bin
folder from Git's list of tracked files..gitignore
to version control (
Team > Add):
.gitignore
displayed in the Package Explorer. To access filters, select the down arrow at right of Package Explorer tab to display View Menu.
.gitignore
.
.gitconfig
file in your home directory.
Hello.java
and implement it
src/Hello.java
in the Resource list of the History View to open your last committed change in the Compare View
Congratulations, you just have mastered your first project using Git !
On the next screen you can see the URLs you may use to access your fresh new repository:
You may want to learn how to work with EGit and Gerrit Code Review by going through the EGit tutorial we held at EclipseCon America 2011.
This tutorial was developed using EGit 0.11 so you should use at least this version. Newer versions may provide an easier way to do certain steps, look at the EGit "New and Noteworthy" documentation.
Best you go through the exercises using the Gerrit-in-a-zip you may download from TODO. See exercise 9 to learn how to use that.
The egit-training repository is also available on http://egit.eclipse.org/. You may clone it from there using
git://egit.eclipse.org/egit-training.git
More details are given in
We held this tutorial "Eclipse Hacker's Guide to the Git Universe" at EclipseCon Europe on Nov 2, 2011.
This tutorial was developed using EGit 1.2-SNAPSHOT so you should use at least this version. Newer versions may provide an easier way to do certain steps, look at the EGit "New and Noteworthy" documentation.
The egit-training repository is also available on http://egit.eclipse.org/. You may clone it from there using
git://egit.eclipse.org/egit-training.git
Find slides and exercises here
![]() |
||
Concepts |