SlideShare a Scribd company logo
Java for Hydrologists
Some useful applications of EGit
R. Rigon, F. Serafin
R.Rigon-IltavolodilavorodiRemoWolf
March 20, 2014
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Objectives
Some useful applications of EGit1
• Introduction to EGit and installation into Eclipse;
• Load local existing project into remote GitHub repository;
• Clone remote project into local repository.
1
All the instructions are taken from Lars Vogel’s blog
http://www.vogella.com/tutorials/EclipseGit/article.html
and from Eclipsepedia https://wiki.eclipse.org/EGit/User_Guide.
Riccardo Rigon, Francesco Serafin
March 20, 2014 2 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Objectives
Some useful applications of EGit1
• Introduction to EGit and installation into Eclipse;
• Load local existing project into remote GitHub repository;
• Clone remote project into local repository.
1
All the instructions are taken from Lars Vogel’s blog
http://www.vogella.com/tutorials/EclipseGit/article.html
and from Eclipsepedia https://wiki.eclipse.org/EGit/User_Guide.
Riccardo Rigon, Francesco Serafin
March 20, 2014 2 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Objectives
Some useful applications of EGit1
• Introduction to EGit and installation into Eclipse;
• Load local existing project into remote GitHub repository;
• Clone remote project into local repository.
1
All the instructions are taken from Lars Vogel’s blog
http://www.vogella.com/tutorials/EclipseGit/article.html
and from Eclipsepedia https://wiki.eclipse.org/EGit/User_Guide.
Riccardo Rigon, Francesco Serafin
March 20, 2014 2 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Objectives
Some useful applications of EGit1
• Introduction to EGit and installation into Eclipse;
• Load local existing project into remote GitHub repository;
• Clone remote project into local repository.
1
All the instructions are taken from Lars Vogel’s blog
http://www.vogella.com/tutorials/EclipseGit/article.html
and from Eclipsepedia https://wiki.eclipse.org/EGit/User_Guide.
Riccardo Rigon, Francesco Serafin
March 20, 2014 2 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Objectives
Some useful applications of EGit1
• Introduction to EGit and installation into Eclipse;
• Load local existing project into remote GitHub repository;
• Clone remote project into local repository.
For the complete guide visit
http://www.vogella.com/tutorials/EclipseGit/article.html
https://wiki.eclipse.org/EGit/User_Guide
1
All the instructions are taken from Lars Vogel’s blog
http://www.vogella.com/tutorials/EclipseGit/article.html
and from Eclipsepedia https://wiki.eclipse.org/EGit/User_Guide.
Riccardo Rigon, Francesco Serafin
March 20, 2014 2 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Git and GitHub
What is Git?
In software development, Git is a distributed revision control and source code
management system2
.
2
Git was initially designed and developed by Linus Torvalds for Linux kernel development
Riccardo Rigon, Francesco Serafin
March 20, 2014 3 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Git and GitHub
What is Git?
In software development, Git is a distributed revision control and source code
management system2
.
Distributed revision control
In computer programming, a distributed revision control system (DRCS) or
distributed version control system (DVCS) keeps track of software revisions and
allows many developers to work on a given project without requiring that they
maintain a connection to a common network.
2
Git was initially designed and developed by Linus Torvalds for Linux kernel development
Riccardo Rigon, Francesco Serafin
March 20, 2014 3 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Git and GitHub
What is Git?
In software development, Git is a distributed revision control and source code
management system2
.
Distributed revision control
In computer programming, a distributed revision control system (DRCS) or
distributed version control system (DVCS) keeps track of software revisions and
allows many developers to work on a given project without requiring that they
maintain a connection to a common network.
Every Git working directory is a full-fledged repository with complete history
and full version tracking capabilities, not dependent on network access or a
central server.
2
Git was initially designed and developed by Linus Torvalds for Linux kernel development
Riccardo Rigon, Francesco Serafin
March 20, 2014 3 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Git and GitHub
What is GitHub?
GitHub is a web-based hosting service for software development projects that
use the Git revision control system. GitHub offers both paid plans for private
repositories, and free accounts for open source projects.
Riccardo Rigon, Francesco Serafin
March 20, 2014 4 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Git and GitHub
What is GitHub?
GitHub is a web-based hosting service for software development projects that
use the Git revision control system. GitHub offers both paid plans for private
repositories, and free accounts for open source projects.
The site provides social networking
functionality such as feeds, followers,
wikis and the social network graph to
display how developers work on their
versions of a repository.
Riccardo Rigon, Francesco Serafin
March 20, 2014 4 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
What is EGit
What is EGit?
EGit is an Eclipse plug-in which allows you to use the distributed version
control system Git directly within the Eclipse IDE.
EGit is based on the JGit library.
Riccardo Rigon, Francesco Serafin
March 20, 2014 5 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
What is EGit
What is EGit?
EGit is an Eclipse plug-in which allows you to use the distributed version
control system Git directly within the Eclipse IDE.
EGit is based on the JGit library.
JGit
JGit is a library which implements the Git
functionality in Java
Riccardo Rigon, Francesco Serafin
March 20, 2014 5 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Installation of Git into Eclipse
Installation of EGit
The EGit plug-in can be installed into every Eclipse IDE installation.
Riccardo Rigon, Francesco Serafin
March 20, 2014 6 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Installation of Git into Eclipse
Installation of EGit
The EGit plug-in can be installed into every Eclipse IDE installation.
Most Eclipse 4.2 and Eclipse 4.3 downloads from Eclipse.org contain EGit in
their default configuration
Riccardo Rigon, Francesco Serafin
March 20, 2014 6 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Installation of Git into Eclipse
Installation of EGit
The EGit plug-in can be installed into every Eclipse IDE installation.
Most Eclipse 4.2 and Eclipse 4.3 downloads from Eclipse.org contain EGit in
their default configuration
No additional installation is required
Riccardo Rigon, Francesco Serafin
March 20, 2014 6 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Installation of Git into Eclipse
Installation of EGit
The EGit plug-in can be installed into every Eclipse IDE installation.
Most Eclipse 4.2 and Eclipse 4.3 downloads from Eclipse.org contain EGit in
their default configuration
No additional installation is required
If the EGit plug-in is missing in your Eclipse installation, you can install it via
the Eclipse Marketplace. Start this manager via the Help→Eclipse
Marketplace menu entry.
Riccardo Rigon, Francesco Serafin
March 20, 2014 6 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Installation of Git into Eclipse
Installation of EGit
The EGit plug-in can be installed into every Eclipse IDE installation.
Most Eclipse 4.2 and Eclipse 4.3 downloads from Eclipse.org contain EGit in
their default configuration
No additional installation is required
If the EGit plug-in is missing in your Eclipse installation, you can install it via
the Eclipse Marketplace. Start this manager via the Help→Eclipse
Marketplace menu entry.
Riccardo Rigon, Francesco Serafin
March 20, 2014 6 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Installation of Git into Eclipse
Eclipse Marketplace
The dialog to install EGit is depicted in the following screenshot.
Riccardo Rigon, Francesco Serafin
March 20, 2014 7 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Installation of Git into Eclipse
Eclipse Marketplace
The dialog to install EGit is depicted in the following screenshot.
Riccardo Rigon, Francesco Serafin
March 20, 2014 7 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Eclipse preferences
Before using EGit you should:
• create a folder where store the projects you want to load on GitHub (the
Git default repository folder);
• configure your name used in Git;
• configure your email address used in Git3
;
• configure your Git default repository folder.
3
Git configuration settings can be configured using the EGit configuration preference page
but this configuration is not store in the Eclipse preferences store but in git configuration files
in order to ensure that native git sees the same configuration.
Riccardo Rigon, Francesco Serafin
March 20, 2014 8 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Eclipse preferences
Before using EGit you should:
• create a folder where store the projects you want to load on GitHub (the
Git default repository folder);
• configure your name used in Git;
• configure your email address used in Git3
;
• configure your Git default repository folder.
3
Git configuration settings can be configured using the EGit configuration preference page
but this configuration is not store in the Eclipse preferences store but in git configuration files
in order to ensure that native git sees the same configuration.
Riccardo Rigon, Francesco Serafin
March 20, 2014 8 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Eclipse preferences
Before using EGit you should:
• create a folder where store the projects you want to load on GitHub (the
Git default repository folder);
• configure your name used in Git;
• configure your email address used in Git3
;
• configure your Git default repository folder.
3
Git configuration settings can be configured using the EGit configuration preference page
but this configuration is not store in the Eclipse preferences store but in git configuration files
in order to ensure that native git sees the same configuration.
Riccardo Rigon, Francesco Serafin
March 20, 2014 8 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Eclipse preferences
Before using EGit you should:
• create a folder where store the projects you want to load on GitHub (the
Git default repository folder);
• configure your name used in Git;
• configure your email address used in Git3
;
• configure your Git default repository folder.
3
Git configuration settings can be configured using the EGit configuration preference page
but this configuration is not store in the Eclipse preferences store but in git configuration files
in order to ensure that native git sees the same configuration.
Riccardo Rigon, Francesco Serafin
March 20, 2014 8 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Eclipse preferences
Before using EGit you should:
• create a folder where store the projects you want to load on GitHub (the
Git default repository folder);
• configure your name used in Git;
• configure your email address used in Git3
;
• configure your Git default repository folder.
3
Git configuration settings can be configured using the EGit configuration preference page
but this configuration is not store in the Eclipse preferences store but in git configuration files
in order to ensure that native git sees the same configuration.
Riccardo Rigon, Francesco Serafin
March 20, 2014 8 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Eclipse preferences
Before using EGit you should:
• create a folder where store the projects you want to load on GitHub (the
Git default repository folder);
• configure your name used in Git;
• configure your email address used in Git3
;
• configure your Git default repository folder.
The Eclipse Git functionality allows you to configure your default user and
email address for a commit. Select
Window→Preferences→Team→Git→Configuration to set them up.
3
Git configuration settings can be configured using the EGit configuration preference page
but this configuration is not store in the Eclipse preferences store but in git configuration files
in order to ensure that native git sees the same configuration.
Riccardo Rigon, Francesco Serafin
March 20, 2014 8 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Set up name and email used in Git
You can add entries to your Git configuration by pressing the Add Entry button
on the Git Configuration preference page.
Riccardo Rigon, Francesco Serafin
March 20, 2014 9 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Set up name and email used in Git
You can add entries to your Git configuration by pressing the Add Entry button
on the Git Configuration preference page.
Riccardo Rigon, Francesco Serafin
March 20, 2014 9 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Set up name used in Git
To add your user, use the user.name as key and your real name as value.
Riccardo Rigon, Francesco Serafin
March 20, 2014 10 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Set up mail used in Git
Repeat the procedure for your email address, using user.email as key as shown
below.
Riccardo Rigon, Francesco Serafin
March 20, 2014 11 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Set up Git default repository folder
You can also enter the default folder for storing Git repositories via the
Window→Preferences→Team→Git and writing the correct path in Default
Repository Folder entry.
Riccardo Rigon, Francesco Serafin
March 20, 2014 12 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Setting up Git in Eclipse
Set up Git default repository folder
You can also enter the default folder for storing Git repositories via the
Window→Preferences→Team→Git and writing the correct path in Default
Repository Folder entry.
Riccardo Rigon, Francesco Serafin
March 20, 2014 12 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
New Java Project
Create a new Java project (we will work with a simple Hello World code).
• Right click in the white space of
the Package Explorer, after click
on New→Java Project;
• In the Dialog that appeared,
remove the tick in Use default
location;
• Click on Browse, in the Dialog
that appeared enter in your Git
default repository folder and create
a new folder named
JavaForHydrologists.example.
Enter in the new folder and click
OK.
• Thus Eclipse automatically sets
the Folder Name like Project
Name. Then click Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 13 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
New Java Project
Create a new Java project (we will work with a simple Hello World code).
• Right click in the white space of
the Package Explorer, after click
on New→Java Project;
• In the Dialog that appeared,
remove the tick in Use default
location;
• Click on Browse, in the Dialog
that appeared enter in your Git
default repository folder and create
a new folder named
JavaForHydrologists.example.
Enter in the new folder and click
OK.
• Thus Eclipse automatically sets
the Folder Name like Project
Name. Then click Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 13 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
New Java Project
Create a new Java project (we will work with a simple Hello World code).
• Right click in the white space of
the Package Explorer, after click
on New→Java Project;
• In the Dialog that appeared,
remove the tick in Use default
location;
• Click on Browse, in the Dialog
that appeared enter in your Git
default repository folder and create
a new folder named
JavaForHydrologists.example.
Enter in the new folder and click
OK.
• Thus Eclipse automatically sets
the Folder Name like Project
Name. Then click Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 13 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
New Java Project
Create a new Java project (we will work with a simple Hello World code).
• Right click in the white space of
the Package Explorer, after click
on New→Java Project;
• In the Dialog that appeared,
remove the tick in Use default
location;
• Click on Browse, in the Dialog
that appeared enter in your Git
default repository folder and create
a new folder named
JavaForHydrologists.example.
Enter in the new folder and click
OK.
• Thus Eclipse automatically sets
the Folder Name like Project
Name. Then click Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 13 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
New Java Project
Create a new Java project (we will work with a simple Hello World code).
• Right click in the white space of
the Package Explorer, after click
on New→Java Project;
• In the Dialog that appeared,
remove the tick in Use default
location;
• Click on Browse, in the Dialog
that appeared enter in your Git
default repository folder and create
a new folder named
JavaForHydrologists.example.
Enter in the new folder and click
OK.
• Thus Eclipse automatically sets
the Folder Name like Project
Name. Then click Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 13 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
New Java Project
Create a new Java project (we will work with a simple Hello World code).
• Right click in the white space of
the Package Explorer, after click
on New→Java Project;
• In the Dialog that appeared,
remove the tick in Use default
location;
• Click on Browse, in the Dialog
that appeared enter in your Git
default repository folder and create
a new folder named
JavaForHydrologists.example.
Enter in the new folder and click
OK.
• Thus Eclipse automatically sets
the Folder Name like Project
Name. Then click Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 13 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
New Java Project
Create a new Java project (we will work with a simple Hello World code).
• Right click in the white space of
the Package Explorer, after click
on New→Java Project;
• In the Dialog that appeared,
remove the tick in Use default
location;
• Click on Browse, in the Dialog
that appeared enter in your Git
default repository folder and create
a new folder named
JavaForHydrologists.example.
Enter in the new folder and click
OK.
• Thus Eclipse automatically sets
the Folder Name like Project
Name. Then click Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 13 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
Hello World!
Now write a simple Hello World code in the newly created project.
Riccardo Rigon, Francesco Serafin
March 20, 2014 14 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
Hello World!
Now write a simple Hello World code in the newly created project.
You must:
• Create a new package;
• Create a new class;
• Write the code.
Riccardo Rigon, Francesco Serafin
March 20, 2014 14 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
Hello World!
Now write a simple Hello World code in the newly created project.
You must:
• Create a new package;
• Create a new class;
• Write the code.
Riccardo Rigon, Francesco Serafin
March 20, 2014 14 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
Hello World!
Now write a simple Hello World code in the newly created project.
You must:
• Create a new package;
• Create a new class;
• Write the code.
Riccardo Rigon, Francesco Serafin
March 20, 2014 14 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
Hello World!
Now write a simple Hello World code in the newly created project.
You must:
• Create a new package;
• Create a new class;
• Write the code.
Riccardo Rigon, Francesco Serafin
March 20, 2014 14 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create the Project
Hello World!
Now write a simple Hello World code in the newly created project.
You must:
• Create a new package;
• Create a new class;
• Write the code.
Once you have wrote the code, we are going to create a local Git Repository.
Riccardo Rigon, Francesco Serafin
March 20, 2014 14 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create local Git Repository
Git Repositories view
First we need to view the Git Repositories present in our Git default repository.
• Click on
Window→Show View→Other;
• In the Show view Dialog, expand
Git and click on Git Repositories.
Then click OK;
• Now you can see the Git
Repositories tab in your Eclipse
IDE.
Riccardo Rigon, Francesco Serafin
March 20, 2014 15 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create local Git Repository
Git Repositories view
First we need to view the Git Repositories present in our Git default repository.
• Click on
Window→Show View→Other;
• In the Show view Dialog, expand
Git and click on Git Repositories.
Then click OK;
• Now you can see the Git
Repositories tab in your Eclipse
IDE.
Riccardo Rigon, Francesco Serafin
March 20, 2014 15 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create local Git Repository
Git Repositories view
First we need to view the Git Repositories present in our Git default repository.
• Click on
Window→Show View→Other;
• In the Show view Dialog, expand
Git and click on Git Repositories.
Then click OK;
• Now you can see the Git
Repositories tab in your Eclipse
IDE.
Riccardo Rigon, Francesco Serafin
March 20, 2014 15 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create local Git Repository
Git Repositories view
First we need to view the Git Repositories present in our Git default repository.
• Click on
Window→Show View→Other;
• In the Show view Dialog, expand
Git and click on Git Repositories.
Then click OK;
• Now you can see the Git
Repositories tab in your Eclipse
IDE.
Riccardo Rigon, Francesco Serafin
March 20, 2014 15 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create local Git Repository
Share the Java Project
To create a new Git local Repository, we have to share the existing project.
• Right click on the
JavaForydrologists.example project
and then click to Team→Share
Project;
• Select the repository type Git and
click Next;
• To configure the Git repository
select Use or create repository in
parent folder of project;
• In the next Dialog select the
project and click to Create
Repository, after click Finish;
Riccardo Rigon, Francesco Serafin
March 20, 2014 16 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create local Git Repository
Share the Java Project
To create a new Git local Repository, we have to share the existing project.
• Right click on the
JavaForydrologists.example project
and then click to Team→Share
Project;
• Select the repository type Git and
click Next;
• To configure the Git repository
select Use or create repository in
parent folder of project;
• In the next Dialog select the
project and click to Create
Repository, after click Finish;
Riccardo Rigon, Francesco Serafin
March 20, 2014 16 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create local Git Repository
Share the Java Project
To create a new Git local Repository, we have to share the existing project.
• Right click on the
JavaForydrologists.example project
and then click to Team→Share
Project;
• Select the repository type Git and
click Next;
• To configure the Git repository
select Use or create repository in
parent folder of project;
• In the next Dialog select the
project and click to Create
Repository, after click Finish;
Riccardo Rigon, Francesco Serafin
March 20, 2014 16 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create local Git Repository
Share the Java Project
To create a new Git local Repository, we have to share the existing project.
• Right click on the
JavaForydrologists.example project
and then click to Team→Share
Project;
• Select the repository type Git and
click Next;
• To configure the Git repository
select Use or create repository in
parent folder of project;
• In the next Dialog select the
project and click to Create
Repository, after click Finish;
Riccardo Rigon, Francesco Serafin
March 20, 2014 16 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create local Git Repository
Share the Java Project
To create a new Git local Repository, we have to share the existing project.
• Right click on the
JavaForydrologists.example project
and then click to Team→Share
Project;
• Select the repository type Git and
click Next;
• To configure the Git repository
select Use or create repository in
parent folder of project;
• In the next Dialog select the
project and click to Create
Repository, after click Finish;
Riccardo Rigon, Francesco Serafin
March 20, 2014 16 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create local Git Repository
But the decorator text “[NO-HEAD]” behind the project shows that this project
is not tracked in a repository and the question mark decorators show that the
.classpath, .project, the .settings files and the src content are not yet under version
control.
Riccardo Rigon, Francesco Serafin
March 20, 2014 17 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
Create a remote repository on GitHub
Go to www.github.com and log in with your credentials. In your home click
like below.
Riccardo Rigon, Francesco Serafin
March 20, 2014 18 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
Create a remote repository on GitHub
Go to www.github.com and log in with your credentials. In your home click
like below.
Riccardo Rigon, Francesco Serafin
March 20, 2014 18 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
Create a remote repository on GitHub
Go to www.github.com and log in with your credentials. In your home click
like below.
Riccardo Rigon, Francesco Serafin
March 20, 2014 18 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
Repository name: JavaFor Hydrologists.example
Riccardo Rigon, Francesco Serafin
March 20, 2014 19 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
Repository name: JavaFor Hydrologists.example
Riccardo Rigon, Francesco Serafin
March 20, 2014 19 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
Description of the repository: First GitHub repository to use with EGit
Riccardo Rigon, Francesco Serafin
March 20, 2014 20 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
Description of the repository: First GitHub repository to use with EGit
Riccardo Rigon, Francesco Serafin
March 20, 2014 20 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
Click to Create repository
Riccardo Rigon, Francesco Serafin
March 20, 2014 21 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
Click to Create repository
Riccardo Rigon, Francesco Serafin
March 20, 2014 21 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
After creation of your new repository, GitHub displays the information about
what you have to do if you want to connetc to this repository via the command
line.
Riccardo Rigon, Francesco Serafin
March 20, 2014 22 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
After creation of your new repository, GitHub displays the information about
what you have to do if you want to connetc to this repository via the command
line.
Riccardo Rigon, Francesco Serafin
March 20, 2014 22 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Create a remote repository on GitHub
After creation of your new repository, GitHub displays the information about
what you have to do if you want to connetc to this repository via the command
line.
As we are going to use EGit you can ignore this information, but don’t close
the window because we need the SSH or HTTP link.
Riccardo Rigon, Francesco Serafin
March 20, 2014 22 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Set Remote in local repository
Create Remote
Now we have the link indispensable to establish the connection between local
and remote repository. Thus, in Eclipse in the Git Repositories tab, expand the
JavaForHydrologists.example and right click on Remote and then Create
Remote.
Riccardo Rigon, Francesco Serafin
March 20, 2014 23 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Set Remote in local repository
Create Remote
• In the open Dialog the Remote
name must be origin, then click
OK;
• To Configure Push, in the next
Dialog click on Change;
• From your Git Remote Repository,
copy the https link and paste it in
the URI space. Eclipse
automatically will fill the other
fileds
• After you must only write your
GitHub credentials and the click to
Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 24 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Set Remote in local repository
Create Remote
• In the open Dialog the Remote
name must be origin, then click
OK;
• To Configure Push, in the next
Dialog click on Change;
• From your Git Remote Repository,
copy the https link and paste it in
the URI space. Eclipse
automatically will fill the other
fileds
• After you must only write your
GitHub credentials and the click to
Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 24 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Set Remote in local repository
Create Remote
• In the open Dialog the Remote
name must be origin, then click
OK;
• To Configure Push, in the next
Dialog click on Change;
• From your Git Remote Repository,
copy the https link and paste it in
the URI space. Eclipse
automatically will fill the other
fileds
• After you must only write your
GitHub credentials and the click to
Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 24 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Set Remote in local repository
Create Remote
• In the open Dialog the Remote
name must be origin, then click
OK;
• To Configure Push, in the next
Dialog click on Change;
• From your Git Remote Repository,
copy the https link and paste it in
the URI space. Eclipse
automatically will fill the other
fileds
• After you must only write your
GitHub credentials and the click to
Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 24 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Set Remote in local repository
Create Remote
• In the open Dialog the Remote
name must be origin, then click
OK;
• To Configure Push, in the next
Dialog click on Change;
• From your Git Remote Repository,
copy the https link and paste it in
the URI space. Eclipse
automatically will fill the other
fileds
• After you must only write your
GitHub credentials and the click to
Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 24 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Basic operations
So we can prepare our local repository to push it to remote repository. The
most important operations are described below. Right click on the project in
the Package Explorer at every step:
• Team→Add to index
to add the selected resource(s) to the
index of Git
• Team→Commit
to open the commit dialog for
committing to your Git repository
Then click Commit
• Team→Push branch
only for the first time, beacuse you must
create the first master branch
• In this Dialog there is nothing to
do, click Next
• Insert your credentials of GitHub
• In this Dialog click Finish
• After push, click OK
Riccardo Rigon, Francesco Serafin
March 20, 2014 25 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Basic operations
So we can prepare our local repository to push it to remote repository. The
most important operations are described below. Right click on the project in
the Package Explorer at every step:
• Team→Add to index
to add the selected resource(s) to the
index of Git
• Team→Commit
to open the commit dialog for
committing to your Git repository
Then click Commit
• Team→Push branch
only for the first time, beacuse you must
create the first master branch
• In this Dialog there is nothing to
do, click Next
• Insert your credentials of GitHub
• In this Dialog click Finish
• After push, click OK
Riccardo Rigon, Francesco Serafin
March 20, 2014 25 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Basic operations
So we can prepare our local repository to push it to remote repository. The
most important operations are described below. Right click on the project in
the Package Explorer at every step:
• Team→Add to index
to add the selected resource(s) to the
index of Git
• Team→Commit
to open the commit dialog for
committing to your Git repository
Then click Commit
• Team→Push branch
only for the first time, beacuse you must
create the first master branch
• In this Dialog there is nothing to
do, click Next
• Insert your credentials of GitHub
• In this Dialog click Finish
• After push, click OK
Riccardo Rigon, Francesco Serafin
March 20, 2014 25 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Basic operations
So we can prepare our local repository to push it to remote repository. The
most important operations are described below. Right click on the project in
the Package Explorer at every step:
• Team→Add to index
to add the selected resource(s) to the
index of Git
• Team→Commit
to open the commit dialog for
committing to your Git repository
Then click Commit
• Team→Push branch
only for the first time, beacuse you must
create the first master branch
• In this Dialog there is nothing to
do, click Next
• Insert your credentials of GitHub
• In this Dialog click Finish
• After push, click OK
Riccardo Rigon, Francesco Serafin
March 20, 2014 25 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Basic operations
So we can prepare our local repository to push it to remote repository. The
most important operations are described below. Right click on the project in
the Package Explorer at every step:
• Team→Add to index
to add the selected resource(s) to the
index of Git
• Team→Commit
to open the commit dialog for
committing to your Git repository
Then click Commit
• Team→Push branch
only for the first time, beacuse you must
create the first master branch
• In this Dialog there is nothing to
do, click Next
• Insert your credentials of GitHub
• In this Dialog click Finish
• After push, click OK
Riccardo Rigon, Francesco Serafin
March 20, 2014 25 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Basic operations
So we can prepare our local repository to push it to remote repository. The
most important operations are described below. Right click on the project in
the Package Explorer at every step:
• Team→Add to index
to add the selected resource(s) to the
index of Git
• Team→Commit
to open the commit dialog for
committing to your Git repository
Then click Commit
• Team→Push branch
only for the first time, beacuse you must
create the first master branch
• In this Dialog there is nothing to
do, click Next
• Insert your credentials of GitHub
• In this Dialog click Finish
• After push, click OK
Riccardo Rigon, Francesco Serafin
March 20, 2014 25 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Basic operations
So we can prepare our local repository to push it to remote repository. The
most important operations are described below. Right click on the project in
the Package Explorer at every step:
• Team→Add to index
to add the selected resource(s) to the
index of Git
• Team→Commit
to open the commit dialog for
committing to your Git repository
Then click Commit
• Team→Push branch
only for the first time, beacuse you must
create the first master branch
• In this Dialog there is nothing to
do, click Next
• Insert your credentials of GitHub
• In this Dialog click Finish
• After push, click OK
Riccardo Rigon, Francesco Serafin
March 20, 2014 25 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Basic operations
So we can prepare our local repository to push it to remote repository. The
most important operations are described below. Right click on the project in
the Package Explorer at every step:
• Team→Add to index
to add the selected resource(s) to the
index of Git
• Team→Commit
to open the commit dialog for
committing to your Git repository
Then click Commit
• Team→Push branch
only for the first time, beacuse you must
create the first master branch
• In this Dialog there is nothing to
do, click Next
• Insert your credentials of GitHub
• In this Dialog click Finish
• After push, click OK
Riccardo Rigon, Francesco Serafin
March 20, 2014 25 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Basic operations
So we can prepare our local repository to push it to remote repository. The
most important operations are described below. Right click on the project in
the Package Explorer at every step:
• Team→Add to index
to add the selected resource(s) to the
index of Git
• Team→Commit
to open the commit dialog for
committing to your Git repository
Then click Commit
• Team→Push branch
only for the first time, beacuse you must
create the first master branch
• In this Dialog there is nothing to
do, click Next
• Insert your credentials of GitHub
• In this Dialog click Finish
• After push, click OK
Riccardo Rigon, Francesco Serafin
March 20, 2014 25 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Basic operations
So we can prepare our local repository to push it to remote repository. The
most important operations are described below. Right click on the project in
the Package Explorer at every step:
• Team→Add to index
to add the selected resource(s) to the
index of Git
• Team→Commit
to open the commit dialog for
committing to your Git repository
Then click Commit
• Team→Push branch
only for the first time, beacuse you must
create the first master branch
• In this Dialog there is nothing to
do, click Next
• Insert your credentials of GitHub
• In this Dialog click Finish
• After push, click OK
Riccardo Rigon, Francesco Serafin
March 20, 2014 25 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Summary of the main steps
Our local repository is been now copied on remote repository.
But once you have create the first master branch, to push your modify you
need follow this basic sequence:
• Team→Add to index
• Team→Commit
• Team→Push to upstream
Riccardo Rigon, Francesco Serafin
March 20, 2014 26 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Summary of the main steps
Our local repository is been now copied on remote repository.
But once you have create the first master branch, to push your modify you
need follow this basic sequence:
• Team→Add to index
• Team→Commit
• Team→Push to upstream
Riccardo Rigon, Francesco Serafin
March 20, 2014 26 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Summary of the main steps
Our local repository is been now copied on remote repository.
But once you have create the first master branch, to push your modify you
need follow this basic sequence:
• Team→Add to index
• Team→Commit
• Team→Push to upstream
Riccardo Rigon, Francesco Serafin
March 20, 2014 26 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Summary of the main steps
Our local repository is been now copied on remote repository.
But once you have create the first master branch, to push your modify you
need follow this basic sequence:
• Team→Add to index
• Team→Commit
• Team→Push to upstream
Riccardo Rigon, Francesco Serafin
March 20, 2014 26 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Problems with basic operations
• After clicking Commit;
• If you cannot Push to Upstream;
• You can fix this problem in the
way shown before.
Riccardo Rigon, Francesco Serafin
March 20, 2014 27 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Problems with basic operations
• After clicking Commit;
• If you cannot Push to Upstream;
• You can fix this problem in the
way shown before.
Riccardo Rigon, Francesco Serafin
March 20, 2014 27 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Problems with basic operations
• After clicking Commit;
• If you cannot Push to Upstream;
• You can fix this problem in the
way shown before.
Riccardo Rigon, Francesco Serafin
March 20, 2014 27 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Problems with basic operations
• After clicking Commit;
• If you cannot Push to Upstream;
• You can fix this problem in the
way shown before.
Riccardo Rigon, Francesco Serafin
March 20, 2014 27 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Push. . . with more settings
Right click on the project that you want to push and Team→Remote→Push
Riccardo Rigon, Francesco Serafin
March 20, 2014 28 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Push. . . with more settings
Select Custom URI and paste in the URI tab the ssh link to your repository.
The ssh form is:
git@github.com:
username/project.git
In my case
git@github.com:francescoS/
JavaForHydrologists.example.git
Select the ssh protocol and
Eclipse will fill all tabs
automatically. After click Next
Riccardo Rigon, Francesco Serafin
March 20, 2014 29 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Push. . . with more settings
In the window Push to: origin click on drop-down menu of the Source ref and
select master [branch] or the branch you want
Riccardo Rigon, Francesco Serafin
March 20, 2014 30 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Push. . . with more settings
Click to Add Spec on the right and Next.
Riccardo Rigon, Francesco Serafin
March 20, 2014 31 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Push. . . with more settings
Click to Add Spec on the right and Next.
Riccardo Rigon, Francesco Serafin
March 20, 2014 31 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Push. . . with more settings
Click to Add Spec on the right and Next.
In the other windows you can see a small summary of the push operation, then
click Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 31 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Basic operations in EGit
Push...with more settings
After Push operations, the appeared Dialog shows the Push Results.
Riccardo Rigon, Francesco Serafin
March 20, 2014 32 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Clone project
Introduction
If we are arrived here, I suppose you have your Git Repositories view in the
Eclipse IDE, otherwise return to 15.
Using the Git Clone Wizard you may clone remote repositories using different
transport protocols. The wizard can be started by clicking on the botton Clone
a Git Repository and add the clone to this view
Riccardo Rigon, Francesco Serafin
March 20, 2014 33 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Clone project
Repository Selection
Copy the URL from GitHub page of the searched project (in this case
https://github.com/francescoS/JavaForHydrologists.firstClone) and
paste it in the URI space of the Clone Git Repository Dialog.
The other fields (Host and Repository path) are filled automatically by Eclipse.Riccardo Rigon, Francesco Serafin
March 20, 2014 34 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Clone project
Repository Selection
Copy the URL from GitHub page of the searched project (in this case
https://github.com/francescoS/JavaForHydrologists.firstClone) and
paste it in the URI space of the Clone Git Repository Dialog.
The other fields (Host and Repository path) are filled automatically by Eclipse.Riccardo Rigon, Francesco Serafin
March 20, 2014 34 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Clone project
Repository Selection
You must fill the fields User and Password with your credentials of GitHub.
Riccardo Rigon, Francesco Serafin
March 20, 2014 35 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Clone project
Repository Selection
You must fill the fields User and Password with your credentials of GitHub.
Riccardo Rigon, Francesco Serafin
March 20, 2014 35 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Clone project
Branch Selection
Click Next, in the Open Dialog choose wich branches shall be cloned from the
remote repository (in this case there is only one branch).
If you are not sure which branches you
need, simply hit Select All. You can
filter the branches by their name by
typing using the text control above the
list.
Riccardo Rigon, Francesco Serafin
March 20, 2014 36 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Clone project
Local Destination
Click Next, in the Open Dialog select the Directory where store the repository
on the local file system and define some initial settings. .
Riccardo Rigon, Francesco Serafin
March 20, 2014 37 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Clone project
Local Destination
Click Next, in the Open Dialog select the Directory where store the repository
on the local file system and define some initial settings. .
Riccardo Rigon, Francesco Serafin
March 20, 2014 37 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Clone project
Local Destination
Click Next, in the Open Dialog select the Directory where store the repository
on the local file system and define some initial settings. Click Finish.
Riccardo Rigon, Francesco Serafin
March 20, 2014 37 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Import the project in the Package Explorer
Import the project in the Package Explorer
Now, to modify the project that you cloned before, you have to import it in your
Package Explorer. Thus, right click on the view Package Explorer and Import.
Riccardo Rigon, Francesco Serafin
March 20, 2014 38 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Import the project in the Package Explorer
Import the project in the Package Explorer
Select Git→Project from Git
Riccardo Rigon, Francesco Serafin
March 20, 2014 39 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Import the project in the Package Explorer
Import the project in the Package Explorer
Select Git→Project from Git
Riccardo Rigon, Francesco Serafin
March 20, 2014 39 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Import the project in the Package Explorer
Import the project in the Package Explorer
Select Git→Project from Git and click Next.
Riccardo Rigon, Francesco Serafin
March 20, 2014 39 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Import the project in the Package Explorer
Import the project in the Package Explorer
Select Existing local repository and click Next.
Riccardo Rigon, Francesco Serafin
March 20, 2014 40 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Import the project in the Package Explorer
Select the repository JavaForHydrologists.firstClone and click Next.
Riccardo Rigon, Francesco Serafin
March 20, 2014 41 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Import the project in the Package Explorer
Select Import existing projects and click Next.
Riccardo Rigon, Francesco Serafin
March 20, 2014 42 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Import the project in the Package Explorer
This is the last Dialog, that summarizes the projects that you are importing.
Then click Finish.
Now the project is visible in the Package Explorer and you can modify it.
Riccardo Rigon, Francesco Serafin
March 20, 2014 43 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
How to view Git History
Git History
But first to modify a cloned repository, it’s important to examine the history of
the entire project. So we are going to open a new tab in our Eclipse IDE:
History.
• Click to
Window→Show View→Other;
• Search and expand Team;
• Then select History and click OK.
Riccardo Rigon, Francesco Serafin
March 20, 2014 44 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
How to view Git History
Git History
But first to modify a cloned repository, it’s important to examine the history of
the entire project. So we are going to open a new tab in our Eclipse IDE:
History.
• Click to
Window→Show View→Other;
• Search and expand Team;
• Then select History and click OK.
Riccardo Rigon, Francesco Serafin
March 20, 2014 44 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
How to view Git History
Git History
But first to modify a cloned repository, it’s important to examine the history of
the entire project. So we are going to open a new tab in our Eclipse IDE:
History.
• Click to
Window→Show View→Other;
• Search and expand Team;
• Then select History and click OK.
Riccardo Rigon, Francesco Serafin
March 20, 2014 44 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
How to view Git History
Git History
But first to modify a cloned repository, it’s important to examine the history of
the entire project. So we are going to open a new tab in our Eclipse IDE:
History.
• Click to
Window→Show View→Other;
• Search and expand Team;
• Then select History and click OK.
Riccardo Rigon, Francesco Serafin
March 20, 2014 44 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
How to view Git History
Git History
Now the History tab is open and you can examine all the history of the project
on which you are going to work.
Riccardo Rigon, Francesco Serafin
March 20, 2014 45 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
How to view Git History
Git History
Now the History tab is open and you can examine all the history of the project
on which you are going to work.
Riccardo Rigon, Francesco Serafin
March 20, 2014 45 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Introduction
Modify the JavaForHydrologists.firstClone project
Now you can modify the simple code that we just cloned.
Some tips:
• you can use the TextIO class rather than simple System.out.println();
• you can read the string from console, so you can create two simple
methods:
• Read from console;
• Write in console.
• COMMENT ALL NEW LINES!
Riccardo Rigon, Francesco Serafin
March 20, 2014 46 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Introduction
A useful tip: JAutodoc
If you want to have a good standard to comment your code, you can use
JAutodoc. It is an Eclipse Plugin for automatically adding Javadoc and file
headers to your source code. It optionally generates initial comments from
element name by using Velocity templates for Javadoc and file headers.
Riccardo Rigon, Francesco Serafin
March 20, 2014 47 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Introduction
A useful tip: JAutodoc
If you want to have a good standard to comment your code, you can use
JAutodoc. It is an Eclipse Plugin for automatically adding Javadoc and file
headers to your source code. It optionally generates initial comments from
element name by using Velocity templates for Javadoc and file headers.
First install it:
Help→Eclipse Marketplace and search
JAutodoc.
Riccardo Rigon, Francesco Serafin
March 20, 2014 47 / 48
Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project
Introduction
How to use JAutodoc
To use JAutodoc, right click on the code and JAutodoc→Add javadoc.
Riccardo Rigon, Francesco Serafin
March 20, 2014 48 / 48

More Related Content

PDF
EclipseCon 2010 tutorial: Understanding git at Eclipse
PPT
Effective Git with Eclipse
PDF
Effective Development With Eclipse Mylyn, Git, Gerrit and Hudson
PPT
Understanding and Using Git at Eclipse
PDF
EclipseCon 2010 talk: Towards contributors heaven
ODP
ESE 2010: Using Git in Eclipse
PPTX
Git General
PPT
OSGi Versioning & Testing
EclipseCon 2010 tutorial: Understanding git at Eclipse
Effective Git with Eclipse
Effective Development With Eclipse Mylyn, Git, Gerrit and Hudson
Understanding and Using Git at Eclipse
EclipseCon 2010 talk: Towards contributors heaven
ESE 2010: Using Git in Eclipse
Git General
OSGi Versioning & Testing

What's hot (20)

PDF
Using Git in Eclipse - Eclipse Summit Europe 2010-11-03
PPTX
Git & git hub
PDF
GitLab as an Alternative Development Platform for Github.com
PDF
Introducing Git and git flow
ZIP
Beginner's Guide to Version Control with Git
PDF
Git and GitHub - The beginning
PPTX
Spring Projects Infrastructure
PDF
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
PDF
How Git and Gerrit make you more productive
PPTX
Hacking Git and GitHub
PDF
OpenTuesday: Agile Testautomatisierung und Continuous Integration
PDF
Assign, Commit, and Review
PDF
Git and GitHub
PDF
Github Case Study By Amil Ali
PDF
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
ODP
Evolution of Version Control In Open Source
PPTX
Gerrit Code Review with GitHub plugin
PPTX
A prentation on github
Using Git in Eclipse - Eclipse Summit Europe 2010-11-03
Git & git hub
GitLab as an Alternative Development Platform for Github.com
Introducing Git and git flow
Beginner's Guide to Version Control with Git
Git and GitHub - The beginning
Spring Projects Infrastructure
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
How Git and Gerrit make you more productive
Hacking Git and GitHub
OpenTuesday: Agile Testautomatisierung und Continuous Integration
Assign, Commit, and Review
Git and GitHub
Github Case Study By Amil Ali
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Evolution of Version Control In Open Source
Gerrit Code Review with GitHub plugin
A prentation on github
Ad

Viewers also liked (20)

PPTX
Git, gitHub, Azure and Visual Studio
PDF
Using the GitHub App to Connect to Bitbucket
PDF
13.3 arno model
PPTX
PDF
A sensitivity Analysis of Eddy Covariance Data Processing Methods for Evapotr...
PDF
11 modern-iuh
PDF
Crop Et And Implications For Irrigation
PDF
6 measurement&representation
PDF
Water platform 2011-2014
PDF
Evapotranspiration Bed Wastewater Treatment and Gardening
PDF
Introduction to post_gis
PDF
TIME INTEGRATION OF EVAPOTRANSPIRATION USING A TWO SOURCE SURFACE ENERGY BALA...
PDF
5 hydrology quantities-measures_instruments_activities
PPTX
Daily evapotranspiration by combining remote sensing with ground observations...
PDF
14 snow hydrology-part1
PDF
Python IDLE (Integrated Development and Learning Environment) for remote sens...
PDF
Session I: Water Consumption – Evapotranspiration (ET) Case Study Tunisia
PDF
10 water in soil-rev 1
PDF
RoccoPancieraMesiano sept25 2013
PDF
Introduction tohydrology c
Git, gitHub, Azure and Visual Studio
Using the GitHub App to Connect to Bitbucket
13.3 arno model
A sensitivity Analysis of Eddy Covariance Data Processing Methods for Evapotr...
11 modern-iuh
Crop Et And Implications For Irrigation
6 measurement&representation
Water platform 2011-2014
Evapotranspiration Bed Wastewater Treatment and Gardening
Introduction to post_gis
TIME INTEGRATION OF EVAPOTRANSPIRATION USING A TWO SOURCE SURFACE ENERGY BALA...
5 hydrology quantities-measures_instruments_activities
Daily evapotranspiration by combining remote sensing with ground observations...
14 snow hydrology-part1
Python IDLE (Integrated Development and Learning Environment) for remote sens...
Session I: Water Consumption – Evapotranspiration (ET) Case Study Tunisia
10 water in soil-rev 1
RoccoPancieraMesiano sept25 2013
Introduction tohydrology c
Ad

Similar to Using Git Inside Eclipse, Pushing/Cloning from GitHub (20)

PDF
Giddy Up on GitHub
PDF
KubeCon EU 2022 Istio, Flux & Flagger.pdf
PDF
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
PPTX
Git, github and the hacktober fest
PDF
Hardening Your CI/CD Pipelines with GitOps and Continuous Security
PPTX
Introduction to GitHub, Open Source and Tech Article
PPTX
Hacktoberfest GDSC BBBDITM.pptx
PDF
Git Tutorial A Comprehensive Guide for Beginners.pdf
PDF
Starting with Git & GitHub
PPTX
3DC Intro to Git Workshop
PPTX
Hacktoberfest 2020 - Open source for beginners
PDF
CICD_1670665418.pdf
PDF
PDF
Beginner Workshop for Student Developers - Tratech-presentation.pdf
PPTX
concordia hacktoberfest.pptx
PDF
CodeMontage CodeFlow 1
PDF
Increase the Velocity of Your Software Releases Using GitHub and DeployHub
PPTX
Hacktoberfest 2021
PPTX
Introduction to git hub
PPTX
Introduction to github using Egit
Giddy Up on GitHub
KubeCon EU 2022 Istio, Flux & Flagger.pdf
Let's Create a GitHub Copilot Extension! - Nick Taylor, Pomerium
Git, github and the hacktober fest
Hardening Your CI/CD Pipelines with GitOps and Continuous Security
Introduction to GitHub, Open Source and Tech Article
Hacktoberfest GDSC BBBDITM.pptx
Git Tutorial A Comprehensive Guide for Beginners.pdf
Starting with Git & GitHub
3DC Intro to Git Workshop
Hacktoberfest 2020 - Open source for beginners
CICD_1670665418.pdf
Beginner Workshop for Student Developers - Tratech-presentation.pdf
concordia hacktoberfest.pptx
CodeMontage CodeFlow 1
Increase the Velocity of Your Software Releases Using GitHub and DeployHub
Hacktoberfest 2021
Introduction to git hub
Introduction to github using Egit

More from AboutHydrology Slides (17)

PDF
Luca Brocca seminario trento
PDF
3b jf h-readingdatafromconsole
PDF
3 jf h-linearequations
PDF
2 jfh-yourveryfirstprogram
PDF
1 jf h-getting started
PDF
Introduction tohydrology b
PDF
La piattaforma acqua
PDF
La convenzione delle alpi
PDF
1 introduction to hydrology
PDF
9 precipitations - rainfall
PDF
13 solar radiation
PDF
15 Evapotranspiration
PDF
4 introduction to uDig
PDF
3 introduction gis
PDF
2 hydro-geomorphology
PDF
0-RealBookStyleAndNotation
PDF
0-RealBooksOfHydrology
Luca Brocca seminario trento
3b jf h-readingdatafromconsole
3 jf h-linearequations
2 jfh-yourveryfirstprogram
1 jf h-getting started
Introduction tohydrology b
La piattaforma acqua
La convenzione delle alpi
1 introduction to hydrology
9 precipitations - rainfall
13 solar radiation
15 Evapotranspiration
4 introduction to uDig
3 introduction gis
2 hydro-geomorphology
0-RealBookStyleAndNotation
0-RealBooksOfHydrology

Recently uploaded (20)

PDF
Empowerment Technology for Senior High School Guide
PDF
HVAC Specification 2024 according to central public works department
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PDF
Complications of Minimal Access-Surgery.pdf
PDF
International_Financial_Reporting_Standa.pdf
PDF
Hazard Identification & Risk Assessment .pdf
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PPTX
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
IGGE1 Understanding the Self1234567891011
Empowerment Technology for Senior High School Guide
HVAC Specification 2024 according to central public works department
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Complications of Minimal Access-Surgery.pdf
International_Financial_Reporting_Standa.pdf
Hazard Identification & Risk Assessment .pdf
Chinmaya Tiranga quiz Grand Finale.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Cambridge-Practice-Tests-for-IELTS-12.docx
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
CHAPTER IV. MAN AND BIOSPHERE AND ITS TOTALITY.pptx
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
AI-driven educational solutions for real-life interventions in the Philippine...
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 2).pdf
History, Philosophy and sociology of education (1).pptx
IGGE1 Understanding the Self1234567891011

Using Git Inside Eclipse, Pushing/Cloning from GitHub

  • 1. Java for Hydrologists Some useful applications of EGit R. Rigon, F. Serafin R.Rigon-IltavolodilavorodiRemoWolf March 20, 2014
  • 2. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Objectives Some useful applications of EGit1 • Introduction to EGit and installation into Eclipse; • Load local existing project into remote GitHub repository; • Clone remote project into local repository. 1 All the instructions are taken from Lars Vogel’s blog http://www.vogella.com/tutorials/EclipseGit/article.html and from Eclipsepedia https://wiki.eclipse.org/EGit/User_Guide. Riccardo Rigon, Francesco Serafin March 20, 2014 2 / 48
  • 3. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Objectives Some useful applications of EGit1 • Introduction to EGit and installation into Eclipse; • Load local existing project into remote GitHub repository; • Clone remote project into local repository. 1 All the instructions are taken from Lars Vogel’s blog http://www.vogella.com/tutorials/EclipseGit/article.html and from Eclipsepedia https://wiki.eclipse.org/EGit/User_Guide. Riccardo Rigon, Francesco Serafin March 20, 2014 2 / 48
  • 4. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Objectives Some useful applications of EGit1 • Introduction to EGit and installation into Eclipse; • Load local existing project into remote GitHub repository; • Clone remote project into local repository. 1 All the instructions are taken from Lars Vogel’s blog http://www.vogella.com/tutorials/EclipseGit/article.html and from Eclipsepedia https://wiki.eclipse.org/EGit/User_Guide. Riccardo Rigon, Francesco Serafin March 20, 2014 2 / 48
  • 5. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Objectives Some useful applications of EGit1 • Introduction to EGit and installation into Eclipse; • Load local existing project into remote GitHub repository; • Clone remote project into local repository. 1 All the instructions are taken from Lars Vogel’s blog http://www.vogella.com/tutorials/EclipseGit/article.html and from Eclipsepedia https://wiki.eclipse.org/EGit/User_Guide. Riccardo Rigon, Francesco Serafin March 20, 2014 2 / 48
  • 6. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Objectives Some useful applications of EGit1 • Introduction to EGit and installation into Eclipse; • Load local existing project into remote GitHub repository; • Clone remote project into local repository. For the complete guide visit http://www.vogella.com/tutorials/EclipseGit/article.html https://wiki.eclipse.org/EGit/User_Guide 1 All the instructions are taken from Lars Vogel’s blog http://www.vogella.com/tutorials/EclipseGit/article.html and from Eclipsepedia https://wiki.eclipse.org/EGit/User_Guide. Riccardo Rigon, Francesco Serafin March 20, 2014 2 / 48
  • 7. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Git and GitHub What is Git? In software development, Git is a distributed revision control and source code management system2 . 2 Git was initially designed and developed by Linus Torvalds for Linux kernel development Riccardo Rigon, Francesco Serafin March 20, 2014 3 / 48
  • 8. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Git and GitHub What is Git? In software development, Git is a distributed revision control and source code management system2 . Distributed revision control In computer programming, a distributed revision control system (DRCS) or distributed version control system (DVCS) keeps track of software revisions and allows many developers to work on a given project without requiring that they maintain a connection to a common network. 2 Git was initially designed and developed by Linus Torvalds for Linux kernel development Riccardo Rigon, Francesco Serafin March 20, 2014 3 / 48
  • 9. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Git and GitHub What is Git? In software development, Git is a distributed revision control and source code management system2 . Distributed revision control In computer programming, a distributed revision control system (DRCS) or distributed version control system (DVCS) keeps track of software revisions and allows many developers to work on a given project without requiring that they maintain a connection to a common network. Every Git working directory is a full-fledged repository with complete history and full version tracking capabilities, not dependent on network access or a central server. 2 Git was initially designed and developed by Linus Torvalds for Linux kernel development Riccardo Rigon, Francesco Serafin March 20, 2014 3 / 48
  • 10. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Git and GitHub What is GitHub? GitHub is a web-based hosting service for software development projects that use the Git revision control system. GitHub offers both paid plans for private repositories, and free accounts for open source projects. Riccardo Rigon, Francesco Serafin March 20, 2014 4 / 48
  • 11. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Git and GitHub What is GitHub? GitHub is a web-based hosting service for software development projects that use the Git revision control system. GitHub offers both paid plans for private repositories, and free accounts for open source projects. The site provides social networking functionality such as feeds, followers, wikis and the social network graph to display how developers work on their versions of a repository. Riccardo Rigon, Francesco Serafin March 20, 2014 4 / 48
  • 12. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project What is EGit What is EGit? EGit is an Eclipse plug-in which allows you to use the distributed version control system Git directly within the Eclipse IDE. EGit is based on the JGit library. Riccardo Rigon, Francesco Serafin March 20, 2014 5 / 48
  • 13. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project What is EGit What is EGit? EGit is an Eclipse plug-in which allows you to use the distributed version control system Git directly within the Eclipse IDE. EGit is based on the JGit library. JGit JGit is a library which implements the Git functionality in Java Riccardo Rigon, Francesco Serafin March 20, 2014 5 / 48
  • 14. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Installation of Git into Eclipse Installation of EGit The EGit plug-in can be installed into every Eclipse IDE installation. Riccardo Rigon, Francesco Serafin March 20, 2014 6 / 48
  • 15. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Installation of Git into Eclipse Installation of EGit The EGit plug-in can be installed into every Eclipse IDE installation. Most Eclipse 4.2 and Eclipse 4.3 downloads from Eclipse.org contain EGit in their default configuration Riccardo Rigon, Francesco Serafin March 20, 2014 6 / 48
  • 16. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Installation of Git into Eclipse Installation of EGit The EGit plug-in can be installed into every Eclipse IDE installation. Most Eclipse 4.2 and Eclipse 4.3 downloads from Eclipse.org contain EGit in their default configuration No additional installation is required Riccardo Rigon, Francesco Serafin March 20, 2014 6 / 48
  • 17. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Installation of Git into Eclipse Installation of EGit The EGit plug-in can be installed into every Eclipse IDE installation. Most Eclipse 4.2 and Eclipse 4.3 downloads from Eclipse.org contain EGit in their default configuration No additional installation is required If the EGit plug-in is missing in your Eclipse installation, you can install it via the Eclipse Marketplace. Start this manager via the Help→Eclipse Marketplace menu entry. Riccardo Rigon, Francesco Serafin March 20, 2014 6 / 48
  • 18. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Installation of Git into Eclipse Installation of EGit The EGit plug-in can be installed into every Eclipse IDE installation. Most Eclipse 4.2 and Eclipse 4.3 downloads from Eclipse.org contain EGit in their default configuration No additional installation is required If the EGit plug-in is missing in your Eclipse installation, you can install it via the Eclipse Marketplace. Start this manager via the Help→Eclipse Marketplace menu entry. Riccardo Rigon, Francesco Serafin March 20, 2014 6 / 48
  • 19. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Installation of Git into Eclipse Eclipse Marketplace The dialog to install EGit is depicted in the following screenshot. Riccardo Rigon, Francesco Serafin March 20, 2014 7 / 48
  • 20. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Installation of Git into Eclipse Eclipse Marketplace The dialog to install EGit is depicted in the following screenshot. Riccardo Rigon, Francesco Serafin March 20, 2014 7 / 48
  • 21. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Eclipse preferences Before using EGit you should: • create a folder where store the projects you want to load on GitHub (the Git default repository folder); • configure your name used in Git; • configure your email address used in Git3 ; • configure your Git default repository folder. 3 Git configuration settings can be configured using the EGit configuration preference page but this configuration is not store in the Eclipse preferences store but in git configuration files in order to ensure that native git sees the same configuration. Riccardo Rigon, Francesco Serafin March 20, 2014 8 / 48
  • 22. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Eclipse preferences Before using EGit you should: • create a folder where store the projects you want to load on GitHub (the Git default repository folder); • configure your name used in Git; • configure your email address used in Git3 ; • configure your Git default repository folder. 3 Git configuration settings can be configured using the EGit configuration preference page but this configuration is not store in the Eclipse preferences store but in git configuration files in order to ensure that native git sees the same configuration. Riccardo Rigon, Francesco Serafin March 20, 2014 8 / 48
  • 23. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Eclipse preferences Before using EGit you should: • create a folder where store the projects you want to load on GitHub (the Git default repository folder); • configure your name used in Git; • configure your email address used in Git3 ; • configure your Git default repository folder. 3 Git configuration settings can be configured using the EGit configuration preference page but this configuration is not store in the Eclipse preferences store but in git configuration files in order to ensure that native git sees the same configuration. Riccardo Rigon, Francesco Serafin March 20, 2014 8 / 48
  • 24. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Eclipse preferences Before using EGit you should: • create a folder where store the projects you want to load on GitHub (the Git default repository folder); • configure your name used in Git; • configure your email address used in Git3 ; • configure your Git default repository folder. 3 Git configuration settings can be configured using the EGit configuration preference page but this configuration is not store in the Eclipse preferences store but in git configuration files in order to ensure that native git sees the same configuration. Riccardo Rigon, Francesco Serafin March 20, 2014 8 / 48
  • 25. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Eclipse preferences Before using EGit you should: • create a folder where store the projects you want to load on GitHub (the Git default repository folder); • configure your name used in Git; • configure your email address used in Git3 ; • configure your Git default repository folder. 3 Git configuration settings can be configured using the EGit configuration preference page but this configuration is not store in the Eclipse preferences store but in git configuration files in order to ensure that native git sees the same configuration. Riccardo Rigon, Francesco Serafin March 20, 2014 8 / 48
  • 26. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Eclipse preferences Before using EGit you should: • create a folder where store the projects you want to load on GitHub (the Git default repository folder); • configure your name used in Git; • configure your email address used in Git3 ; • configure your Git default repository folder. The Eclipse Git functionality allows you to configure your default user and email address for a commit. Select Window→Preferences→Team→Git→Configuration to set them up. 3 Git configuration settings can be configured using the EGit configuration preference page but this configuration is not store in the Eclipse preferences store but in git configuration files in order to ensure that native git sees the same configuration. Riccardo Rigon, Francesco Serafin March 20, 2014 8 / 48
  • 27. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Set up name and email used in Git You can add entries to your Git configuration by pressing the Add Entry button on the Git Configuration preference page. Riccardo Rigon, Francesco Serafin March 20, 2014 9 / 48
  • 28. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Set up name and email used in Git You can add entries to your Git configuration by pressing the Add Entry button on the Git Configuration preference page. Riccardo Rigon, Francesco Serafin March 20, 2014 9 / 48
  • 29. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Set up name used in Git To add your user, use the user.name as key and your real name as value. Riccardo Rigon, Francesco Serafin March 20, 2014 10 / 48
  • 30. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Set up mail used in Git Repeat the procedure for your email address, using user.email as key as shown below. Riccardo Rigon, Francesco Serafin March 20, 2014 11 / 48
  • 31. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Set up Git default repository folder You can also enter the default folder for storing Git repositories via the Window→Preferences→Team→Git and writing the correct path in Default Repository Folder entry. Riccardo Rigon, Francesco Serafin March 20, 2014 12 / 48
  • 32. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Setting up Git in Eclipse Set up Git default repository folder You can also enter the default folder for storing Git repositories via the Window→Preferences→Team→Git and writing the correct path in Default Repository Folder entry. Riccardo Rigon, Francesco Serafin March 20, 2014 12 / 48
  • 33. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project New Java Project Create a new Java project (we will work with a simple Hello World code). • Right click in the white space of the Package Explorer, after click on New→Java Project; • In the Dialog that appeared, remove the tick in Use default location; • Click on Browse, in the Dialog that appeared enter in your Git default repository folder and create a new folder named JavaForHydrologists.example. Enter in the new folder and click OK. • Thus Eclipse automatically sets the Folder Name like Project Name. Then click Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 13 / 48
  • 34. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project New Java Project Create a new Java project (we will work with a simple Hello World code). • Right click in the white space of the Package Explorer, after click on New→Java Project; • In the Dialog that appeared, remove the tick in Use default location; • Click on Browse, in the Dialog that appeared enter in your Git default repository folder and create a new folder named JavaForHydrologists.example. Enter in the new folder and click OK. • Thus Eclipse automatically sets the Folder Name like Project Name. Then click Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 13 / 48
  • 35. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project New Java Project Create a new Java project (we will work with a simple Hello World code). • Right click in the white space of the Package Explorer, after click on New→Java Project; • In the Dialog that appeared, remove the tick in Use default location; • Click on Browse, in the Dialog that appeared enter in your Git default repository folder and create a new folder named JavaForHydrologists.example. Enter in the new folder and click OK. • Thus Eclipse automatically sets the Folder Name like Project Name. Then click Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 13 / 48
  • 36. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project New Java Project Create a new Java project (we will work with a simple Hello World code). • Right click in the white space of the Package Explorer, after click on New→Java Project; • In the Dialog that appeared, remove the tick in Use default location; • Click on Browse, in the Dialog that appeared enter in your Git default repository folder and create a new folder named JavaForHydrologists.example. Enter in the new folder and click OK. • Thus Eclipse automatically sets the Folder Name like Project Name. Then click Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 13 / 48
  • 37. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project New Java Project Create a new Java project (we will work with a simple Hello World code). • Right click in the white space of the Package Explorer, after click on New→Java Project; • In the Dialog that appeared, remove the tick in Use default location; • Click on Browse, in the Dialog that appeared enter in your Git default repository folder and create a new folder named JavaForHydrologists.example. Enter in the new folder and click OK. • Thus Eclipse automatically sets the Folder Name like Project Name. Then click Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 13 / 48
  • 38. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project New Java Project Create a new Java project (we will work with a simple Hello World code). • Right click in the white space of the Package Explorer, after click on New→Java Project; • In the Dialog that appeared, remove the tick in Use default location; • Click on Browse, in the Dialog that appeared enter in your Git default repository folder and create a new folder named JavaForHydrologists.example. Enter in the new folder and click OK. • Thus Eclipse automatically sets the Folder Name like Project Name. Then click Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 13 / 48
  • 39. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project New Java Project Create a new Java project (we will work with a simple Hello World code). • Right click in the white space of the Package Explorer, after click on New→Java Project; • In the Dialog that appeared, remove the tick in Use default location; • Click on Browse, in the Dialog that appeared enter in your Git default repository folder and create a new folder named JavaForHydrologists.example. Enter in the new folder and click OK. • Thus Eclipse automatically sets the Folder Name like Project Name. Then click Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 13 / 48
  • 40. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project Hello World! Now write a simple Hello World code in the newly created project. Riccardo Rigon, Francesco Serafin March 20, 2014 14 / 48
  • 41. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project Hello World! Now write a simple Hello World code in the newly created project. You must: • Create a new package; • Create a new class; • Write the code. Riccardo Rigon, Francesco Serafin March 20, 2014 14 / 48
  • 42. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project Hello World! Now write a simple Hello World code in the newly created project. You must: • Create a new package; • Create a new class; • Write the code. Riccardo Rigon, Francesco Serafin March 20, 2014 14 / 48
  • 43. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project Hello World! Now write a simple Hello World code in the newly created project. You must: • Create a new package; • Create a new class; • Write the code. Riccardo Rigon, Francesco Serafin March 20, 2014 14 / 48
  • 44. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project Hello World! Now write a simple Hello World code in the newly created project. You must: • Create a new package; • Create a new class; • Write the code. Riccardo Rigon, Francesco Serafin March 20, 2014 14 / 48
  • 45. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create the Project Hello World! Now write a simple Hello World code in the newly created project. You must: • Create a new package; • Create a new class; • Write the code. Once you have wrote the code, we are going to create a local Git Repository. Riccardo Rigon, Francesco Serafin March 20, 2014 14 / 48
  • 46. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create local Git Repository Git Repositories view First we need to view the Git Repositories present in our Git default repository. • Click on Window→Show View→Other; • In the Show view Dialog, expand Git and click on Git Repositories. Then click OK; • Now you can see the Git Repositories tab in your Eclipse IDE. Riccardo Rigon, Francesco Serafin March 20, 2014 15 / 48
  • 47. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create local Git Repository Git Repositories view First we need to view the Git Repositories present in our Git default repository. • Click on Window→Show View→Other; • In the Show view Dialog, expand Git and click on Git Repositories. Then click OK; • Now you can see the Git Repositories tab in your Eclipse IDE. Riccardo Rigon, Francesco Serafin March 20, 2014 15 / 48
  • 48. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create local Git Repository Git Repositories view First we need to view the Git Repositories present in our Git default repository. • Click on Window→Show View→Other; • In the Show view Dialog, expand Git and click on Git Repositories. Then click OK; • Now you can see the Git Repositories tab in your Eclipse IDE. Riccardo Rigon, Francesco Serafin March 20, 2014 15 / 48
  • 49. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create local Git Repository Git Repositories view First we need to view the Git Repositories present in our Git default repository. • Click on Window→Show View→Other; • In the Show view Dialog, expand Git and click on Git Repositories. Then click OK; • Now you can see the Git Repositories tab in your Eclipse IDE. Riccardo Rigon, Francesco Serafin March 20, 2014 15 / 48
  • 50. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create local Git Repository Share the Java Project To create a new Git local Repository, we have to share the existing project. • Right click on the JavaForydrologists.example project and then click to Team→Share Project; • Select the repository type Git and click Next; • To configure the Git repository select Use or create repository in parent folder of project; • In the next Dialog select the project and click to Create Repository, after click Finish; Riccardo Rigon, Francesco Serafin March 20, 2014 16 / 48
  • 51. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create local Git Repository Share the Java Project To create a new Git local Repository, we have to share the existing project. • Right click on the JavaForydrologists.example project and then click to Team→Share Project; • Select the repository type Git and click Next; • To configure the Git repository select Use or create repository in parent folder of project; • In the next Dialog select the project and click to Create Repository, after click Finish; Riccardo Rigon, Francesco Serafin March 20, 2014 16 / 48
  • 52. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create local Git Repository Share the Java Project To create a new Git local Repository, we have to share the existing project. • Right click on the JavaForydrologists.example project and then click to Team→Share Project; • Select the repository type Git and click Next; • To configure the Git repository select Use or create repository in parent folder of project; • In the next Dialog select the project and click to Create Repository, after click Finish; Riccardo Rigon, Francesco Serafin March 20, 2014 16 / 48
  • 53. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create local Git Repository Share the Java Project To create a new Git local Repository, we have to share the existing project. • Right click on the JavaForydrologists.example project and then click to Team→Share Project; • Select the repository type Git and click Next; • To configure the Git repository select Use or create repository in parent folder of project; • In the next Dialog select the project and click to Create Repository, after click Finish; Riccardo Rigon, Francesco Serafin March 20, 2014 16 / 48
  • 54. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create local Git Repository Share the Java Project To create a new Git local Repository, we have to share the existing project. • Right click on the JavaForydrologists.example project and then click to Team→Share Project; • Select the repository type Git and click Next; • To configure the Git repository select Use or create repository in parent folder of project; • In the next Dialog select the project and click to Create Repository, after click Finish; Riccardo Rigon, Francesco Serafin March 20, 2014 16 / 48
  • 55. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create local Git Repository But the decorator text “[NO-HEAD]” behind the project shows that this project is not tracked in a repository and the question mark decorators show that the .classpath, .project, the .settings files and the src content are not yet under version control. Riccardo Rigon, Francesco Serafin March 20, 2014 17 / 48
  • 56. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub Create a remote repository on GitHub Go to www.github.com and log in with your credentials. In your home click like below. Riccardo Rigon, Francesco Serafin March 20, 2014 18 / 48
  • 57. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub Create a remote repository on GitHub Go to www.github.com and log in with your credentials. In your home click like below. Riccardo Rigon, Francesco Serafin March 20, 2014 18 / 48
  • 58. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub Create a remote repository on GitHub Go to www.github.com and log in with your credentials. In your home click like below. Riccardo Rigon, Francesco Serafin March 20, 2014 18 / 48
  • 59. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub Repository name: JavaFor Hydrologists.example Riccardo Rigon, Francesco Serafin March 20, 2014 19 / 48
  • 60. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub Repository name: JavaFor Hydrologists.example Riccardo Rigon, Francesco Serafin March 20, 2014 19 / 48
  • 61. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub Description of the repository: First GitHub repository to use with EGit Riccardo Rigon, Francesco Serafin March 20, 2014 20 / 48
  • 62. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub Description of the repository: First GitHub repository to use with EGit Riccardo Rigon, Francesco Serafin March 20, 2014 20 / 48
  • 63. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub Click to Create repository Riccardo Rigon, Francesco Serafin March 20, 2014 21 / 48
  • 64. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub Click to Create repository Riccardo Rigon, Francesco Serafin March 20, 2014 21 / 48
  • 65. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub After creation of your new repository, GitHub displays the information about what you have to do if you want to connetc to this repository via the command line. Riccardo Rigon, Francesco Serafin March 20, 2014 22 / 48
  • 66. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub After creation of your new repository, GitHub displays the information about what you have to do if you want to connetc to this repository via the command line. Riccardo Rigon, Francesco Serafin March 20, 2014 22 / 48
  • 67. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Create a remote repository on GitHub After creation of your new repository, GitHub displays the information about what you have to do if you want to connetc to this repository via the command line. As we are going to use EGit you can ignore this information, but don’t close the window because we need the SSH or HTTP link. Riccardo Rigon, Francesco Serafin March 20, 2014 22 / 48
  • 68. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Set Remote in local repository Create Remote Now we have the link indispensable to establish the connection between local and remote repository. Thus, in Eclipse in the Git Repositories tab, expand the JavaForHydrologists.example and right click on Remote and then Create Remote. Riccardo Rigon, Francesco Serafin March 20, 2014 23 / 48
  • 69. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Set Remote in local repository Create Remote • In the open Dialog the Remote name must be origin, then click OK; • To Configure Push, in the next Dialog click on Change; • From your Git Remote Repository, copy the https link and paste it in the URI space. Eclipse automatically will fill the other fileds • After you must only write your GitHub credentials and the click to Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 24 / 48
  • 70. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Set Remote in local repository Create Remote • In the open Dialog the Remote name must be origin, then click OK; • To Configure Push, in the next Dialog click on Change; • From your Git Remote Repository, copy the https link and paste it in the URI space. Eclipse automatically will fill the other fileds • After you must only write your GitHub credentials and the click to Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 24 / 48
  • 71. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Set Remote in local repository Create Remote • In the open Dialog the Remote name must be origin, then click OK; • To Configure Push, in the next Dialog click on Change; • From your Git Remote Repository, copy the https link and paste it in the URI space. Eclipse automatically will fill the other fileds • After you must only write your GitHub credentials and the click to Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 24 / 48
  • 72. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Set Remote in local repository Create Remote • In the open Dialog the Remote name must be origin, then click OK; • To Configure Push, in the next Dialog click on Change; • From your Git Remote Repository, copy the https link and paste it in the URI space. Eclipse automatically will fill the other fileds • After you must only write your GitHub credentials and the click to Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 24 / 48
  • 73. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Set Remote in local repository Create Remote • In the open Dialog the Remote name must be origin, then click OK; • To Configure Push, in the next Dialog click on Change; • From your Git Remote Repository, copy the https link and paste it in the URI space. Eclipse automatically will fill the other fileds • After you must only write your GitHub credentials and the click to Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 24 / 48
  • 74. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Basic operations So we can prepare our local repository to push it to remote repository. The most important operations are described below. Right click on the project in the Package Explorer at every step: • Team→Add to index to add the selected resource(s) to the index of Git • Team→Commit to open the commit dialog for committing to your Git repository Then click Commit • Team→Push branch only for the first time, beacuse you must create the first master branch • In this Dialog there is nothing to do, click Next • Insert your credentials of GitHub • In this Dialog click Finish • After push, click OK Riccardo Rigon, Francesco Serafin March 20, 2014 25 / 48
  • 75. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Basic operations So we can prepare our local repository to push it to remote repository. The most important operations are described below. Right click on the project in the Package Explorer at every step: • Team→Add to index to add the selected resource(s) to the index of Git • Team→Commit to open the commit dialog for committing to your Git repository Then click Commit • Team→Push branch only for the first time, beacuse you must create the first master branch • In this Dialog there is nothing to do, click Next • Insert your credentials of GitHub • In this Dialog click Finish • After push, click OK Riccardo Rigon, Francesco Serafin March 20, 2014 25 / 48
  • 76. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Basic operations So we can prepare our local repository to push it to remote repository. The most important operations are described below. Right click on the project in the Package Explorer at every step: • Team→Add to index to add the selected resource(s) to the index of Git • Team→Commit to open the commit dialog for committing to your Git repository Then click Commit • Team→Push branch only for the first time, beacuse you must create the first master branch • In this Dialog there is nothing to do, click Next • Insert your credentials of GitHub • In this Dialog click Finish • After push, click OK Riccardo Rigon, Francesco Serafin March 20, 2014 25 / 48
  • 77. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Basic operations So we can prepare our local repository to push it to remote repository. The most important operations are described below. Right click on the project in the Package Explorer at every step: • Team→Add to index to add the selected resource(s) to the index of Git • Team→Commit to open the commit dialog for committing to your Git repository Then click Commit • Team→Push branch only for the first time, beacuse you must create the first master branch • In this Dialog there is nothing to do, click Next • Insert your credentials of GitHub • In this Dialog click Finish • After push, click OK Riccardo Rigon, Francesco Serafin March 20, 2014 25 / 48
  • 78. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Basic operations So we can prepare our local repository to push it to remote repository. The most important operations are described below. Right click on the project in the Package Explorer at every step: • Team→Add to index to add the selected resource(s) to the index of Git • Team→Commit to open the commit dialog for committing to your Git repository Then click Commit • Team→Push branch only for the first time, beacuse you must create the first master branch • In this Dialog there is nothing to do, click Next • Insert your credentials of GitHub • In this Dialog click Finish • After push, click OK Riccardo Rigon, Francesco Serafin March 20, 2014 25 / 48
  • 79. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Basic operations So we can prepare our local repository to push it to remote repository. The most important operations are described below. Right click on the project in the Package Explorer at every step: • Team→Add to index to add the selected resource(s) to the index of Git • Team→Commit to open the commit dialog for committing to your Git repository Then click Commit • Team→Push branch only for the first time, beacuse you must create the first master branch • In this Dialog there is nothing to do, click Next • Insert your credentials of GitHub • In this Dialog click Finish • After push, click OK Riccardo Rigon, Francesco Serafin March 20, 2014 25 / 48
  • 80. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Basic operations So we can prepare our local repository to push it to remote repository. The most important operations are described below. Right click on the project in the Package Explorer at every step: • Team→Add to index to add the selected resource(s) to the index of Git • Team→Commit to open the commit dialog for committing to your Git repository Then click Commit • Team→Push branch only for the first time, beacuse you must create the first master branch • In this Dialog there is nothing to do, click Next • Insert your credentials of GitHub • In this Dialog click Finish • After push, click OK Riccardo Rigon, Francesco Serafin March 20, 2014 25 / 48
  • 81. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Basic operations So we can prepare our local repository to push it to remote repository. The most important operations are described below. Right click on the project in the Package Explorer at every step: • Team→Add to index to add the selected resource(s) to the index of Git • Team→Commit to open the commit dialog for committing to your Git repository Then click Commit • Team→Push branch only for the first time, beacuse you must create the first master branch • In this Dialog there is nothing to do, click Next • Insert your credentials of GitHub • In this Dialog click Finish • After push, click OK Riccardo Rigon, Francesco Serafin March 20, 2014 25 / 48
  • 82. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Basic operations So we can prepare our local repository to push it to remote repository. The most important operations are described below. Right click on the project in the Package Explorer at every step: • Team→Add to index to add the selected resource(s) to the index of Git • Team→Commit to open the commit dialog for committing to your Git repository Then click Commit • Team→Push branch only for the first time, beacuse you must create the first master branch • In this Dialog there is nothing to do, click Next • Insert your credentials of GitHub • In this Dialog click Finish • After push, click OK Riccardo Rigon, Francesco Serafin March 20, 2014 25 / 48
  • 83. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Basic operations So we can prepare our local repository to push it to remote repository. The most important operations are described below. Right click on the project in the Package Explorer at every step: • Team→Add to index to add the selected resource(s) to the index of Git • Team→Commit to open the commit dialog for committing to your Git repository Then click Commit • Team→Push branch only for the first time, beacuse you must create the first master branch • In this Dialog there is nothing to do, click Next • Insert your credentials of GitHub • In this Dialog click Finish • After push, click OK Riccardo Rigon, Francesco Serafin March 20, 2014 25 / 48
  • 84. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Summary of the main steps Our local repository is been now copied on remote repository. But once you have create the first master branch, to push your modify you need follow this basic sequence: • Team→Add to index • Team→Commit • Team→Push to upstream Riccardo Rigon, Francesco Serafin March 20, 2014 26 / 48
  • 85. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Summary of the main steps Our local repository is been now copied on remote repository. But once you have create the first master branch, to push your modify you need follow this basic sequence: • Team→Add to index • Team→Commit • Team→Push to upstream Riccardo Rigon, Francesco Serafin March 20, 2014 26 / 48
  • 86. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Summary of the main steps Our local repository is been now copied on remote repository. But once you have create the first master branch, to push your modify you need follow this basic sequence: • Team→Add to index • Team→Commit • Team→Push to upstream Riccardo Rigon, Francesco Serafin March 20, 2014 26 / 48
  • 87. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Summary of the main steps Our local repository is been now copied on remote repository. But once you have create the first master branch, to push your modify you need follow this basic sequence: • Team→Add to index • Team→Commit • Team→Push to upstream Riccardo Rigon, Francesco Serafin March 20, 2014 26 / 48
  • 88. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Problems with basic operations • After clicking Commit; • If you cannot Push to Upstream; • You can fix this problem in the way shown before. Riccardo Rigon, Francesco Serafin March 20, 2014 27 / 48
  • 89. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Problems with basic operations • After clicking Commit; • If you cannot Push to Upstream; • You can fix this problem in the way shown before. Riccardo Rigon, Francesco Serafin March 20, 2014 27 / 48
  • 90. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Problems with basic operations • After clicking Commit; • If you cannot Push to Upstream; • You can fix this problem in the way shown before. Riccardo Rigon, Francesco Serafin March 20, 2014 27 / 48
  • 91. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Problems with basic operations • After clicking Commit; • If you cannot Push to Upstream; • You can fix this problem in the way shown before. Riccardo Rigon, Francesco Serafin March 20, 2014 27 / 48
  • 92. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Push. . . with more settings Right click on the project that you want to push and Team→Remote→Push Riccardo Rigon, Francesco Serafin March 20, 2014 28 / 48
  • 93. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Push. . . with more settings Select Custom URI and paste in the URI tab the ssh link to your repository. The ssh form is: [email protected]: username/project.git In my case [email protected]:francescoS/ JavaForHydrologists.example.git Select the ssh protocol and Eclipse will fill all tabs automatically. After click Next Riccardo Rigon, Francesco Serafin March 20, 2014 29 / 48
  • 94. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Push. . . with more settings In the window Push to: origin click on drop-down menu of the Source ref and select master [branch] or the branch you want Riccardo Rigon, Francesco Serafin March 20, 2014 30 / 48
  • 95. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Push. . . with more settings Click to Add Spec on the right and Next. Riccardo Rigon, Francesco Serafin March 20, 2014 31 / 48
  • 96. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Push. . . with more settings Click to Add Spec on the right and Next. Riccardo Rigon, Francesco Serafin March 20, 2014 31 / 48
  • 97. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Push. . . with more settings Click to Add Spec on the right and Next. In the other windows you can see a small summary of the push operation, then click Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 31 / 48
  • 98. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Basic operations in EGit Push...with more settings After Push operations, the appeared Dialog shows the Push Results. Riccardo Rigon, Francesco Serafin March 20, 2014 32 / 48
  • 99. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Clone project Introduction If we are arrived here, I suppose you have your Git Repositories view in the Eclipse IDE, otherwise return to 15. Using the Git Clone Wizard you may clone remote repositories using different transport protocols. The wizard can be started by clicking on the botton Clone a Git Repository and add the clone to this view Riccardo Rigon, Francesco Serafin March 20, 2014 33 / 48
  • 100. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Clone project Repository Selection Copy the URL from GitHub page of the searched project (in this case https://github.com/francescoS/JavaForHydrologists.firstClone) and paste it in the URI space of the Clone Git Repository Dialog. The other fields (Host and Repository path) are filled automatically by Eclipse.Riccardo Rigon, Francesco Serafin March 20, 2014 34 / 48
  • 101. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Clone project Repository Selection Copy the URL from GitHub page of the searched project (in this case https://github.com/francescoS/JavaForHydrologists.firstClone) and paste it in the URI space of the Clone Git Repository Dialog. The other fields (Host and Repository path) are filled automatically by Eclipse.Riccardo Rigon, Francesco Serafin March 20, 2014 34 / 48
  • 102. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Clone project Repository Selection You must fill the fields User and Password with your credentials of GitHub. Riccardo Rigon, Francesco Serafin March 20, 2014 35 / 48
  • 103. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Clone project Repository Selection You must fill the fields User and Password with your credentials of GitHub. Riccardo Rigon, Francesco Serafin March 20, 2014 35 / 48
  • 104. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Clone project Branch Selection Click Next, in the Open Dialog choose wich branches shall be cloned from the remote repository (in this case there is only one branch). If you are not sure which branches you need, simply hit Select All. You can filter the branches by their name by typing using the text control above the list. Riccardo Rigon, Francesco Serafin March 20, 2014 36 / 48
  • 105. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Clone project Local Destination Click Next, in the Open Dialog select the Directory where store the repository on the local file system and define some initial settings. . Riccardo Rigon, Francesco Serafin March 20, 2014 37 / 48
  • 106. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Clone project Local Destination Click Next, in the Open Dialog select the Directory where store the repository on the local file system and define some initial settings. . Riccardo Rigon, Francesco Serafin March 20, 2014 37 / 48
  • 107. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Clone project Local Destination Click Next, in the Open Dialog select the Directory where store the repository on the local file system and define some initial settings. Click Finish. Riccardo Rigon, Francesco Serafin March 20, 2014 37 / 48
  • 108. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Import the project in the Package Explorer Import the project in the Package Explorer Now, to modify the project that you cloned before, you have to import it in your Package Explorer. Thus, right click on the view Package Explorer and Import. Riccardo Rigon, Francesco Serafin March 20, 2014 38 / 48
  • 109. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Import the project in the Package Explorer Import the project in the Package Explorer Select Git→Project from Git Riccardo Rigon, Francesco Serafin March 20, 2014 39 / 48
  • 110. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Import the project in the Package Explorer Import the project in the Package Explorer Select Git→Project from Git Riccardo Rigon, Francesco Serafin March 20, 2014 39 / 48
  • 111. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Import the project in the Package Explorer Import the project in the Package Explorer Select Git→Project from Git and click Next. Riccardo Rigon, Francesco Serafin March 20, 2014 39 / 48
  • 112. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Import the project in the Package Explorer Import the project in the Package Explorer Select Existing local repository and click Next. Riccardo Rigon, Francesco Serafin March 20, 2014 40 / 48
  • 113. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Import the project in the Package Explorer Select the repository JavaForHydrologists.firstClone and click Next. Riccardo Rigon, Francesco Serafin March 20, 2014 41 / 48
  • 114. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Import the project in the Package Explorer Select Import existing projects and click Next. Riccardo Rigon, Francesco Serafin March 20, 2014 42 / 48
  • 115. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Import the project in the Package Explorer This is the last Dialog, that summarizes the projects that you are importing. Then click Finish. Now the project is visible in the Package Explorer and you can modify it. Riccardo Rigon, Francesco Serafin March 20, 2014 43 / 48
  • 116. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project How to view Git History Git History But first to modify a cloned repository, it’s important to examine the history of the entire project. So we are going to open a new tab in our Eclipse IDE: History. • Click to Window→Show View→Other; • Search and expand Team; • Then select History and click OK. Riccardo Rigon, Francesco Serafin March 20, 2014 44 / 48
  • 117. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project How to view Git History Git History But first to modify a cloned repository, it’s important to examine the history of the entire project. So we are going to open a new tab in our Eclipse IDE: History. • Click to Window→Show View→Other; • Search and expand Team; • Then select History and click OK. Riccardo Rigon, Francesco Serafin March 20, 2014 44 / 48
  • 118. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project How to view Git History Git History But first to modify a cloned repository, it’s important to examine the history of the entire project. So we are going to open a new tab in our Eclipse IDE: History. • Click to Window→Show View→Other; • Search and expand Team; • Then select History and click OK. Riccardo Rigon, Francesco Serafin March 20, 2014 44 / 48
  • 119. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project How to view Git History Git History But first to modify a cloned repository, it’s important to examine the history of the entire project. So we are going to open a new tab in our Eclipse IDE: History. • Click to Window→Show View→Other; • Search and expand Team; • Then select History and click OK. Riccardo Rigon, Francesco Serafin March 20, 2014 44 / 48
  • 120. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project How to view Git History Git History Now the History tab is open and you can examine all the history of the project on which you are going to work. Riccardo Rigon, Francesco Serafin March 20, 2014 45 / 48
  • 121. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project How to view Git History Git History Now the History tab is open and you can examine all the history of the project on which you are going to work. Riccardo Rigon, Francesco Serafin March 20, 2014 45 / 48
  • 122. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Introduction Modify the JavaForHydrologists.firstClone project Now you can modify the simple code that we just cloned. Some tips: • you can use the TextIO class rather than simple System.out.println(); • you can read the string from console, so you can create two simple methods: • Read from console; • Write in console. • COMMENT ALL NEW LINES! Riccardo Rigon, Francesco Serafin March 20, 2014 46 / 48
  • 123. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Introduction A useful tip: JAutodoc If you want to have a good standard to comment your code, you can use JAutodoc. It is an Eclipse Plugin for automatically adding Javadoc and file headers to your source code. It optionally generates initial comments from element name by using Velocity templates for Javadoc and file headers. Riccardo Rigon, Francesco Serafin March 20, 2014 47 / 48
  • 124. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Introduction A useful tip: JAutodoc If you want to have a good standard to comment your code, you can use JAutodoc. It is an Eclipse Plugin for automatically adding Javadoc and file headers to your source code. It optionally generates initial comments from element name by using Velocity templates for Javadoc and file headers. First install it: Help→Eclipse Marketplace and search JAutodoc. Riccardo Rigon, Francesco Serafin March 20, 2014 47 / 48
  • 125. Introduction Push new local project on remote Clone remote repo in your local Push modifies of cloned project Introduction How to use JAutodoc To use JAutodoc, right click on the code and JAutodoc→Add javadoc. Riccardo Rigon, Francesco Serafin March 20, 2014 48 / 48