Jump to: navigation, search

Difference between revisions of "EGit/User Guide/Remote"

(Local Destination)
m (Cloning remote Repositories)
 
(10 intermediate revisions by 6 users not shown)
Line 5: Line 5:
 
== Cloning remote Repositories ==
 
== Cloning remote Repositories ==
  
With the Git import wizard you can clone remote repositories using different protocols. You can additionally import existing eclipse projects into your workspace and share the projects with the Git team provider.  
+
Using the Git import wizard you can clone remote repositories using different transport protocols.
 +
Additionally you may import existing Eclipse projects into your workspace and share the projects with the Git team provider.  
  
 
Start the import wizard by navigating to File -> Import... and choose "Git Repository".
 
Start the import wizard by navigating to File -> Import... and choose "Git Repository".
 
[[Image:01-CloneExistingRepository.png]]
 
  
 
=== Repository Selection ===
 
=== Repository Selection ===
  
On the first page of the wizard you can enter the location of the remote repository:
+
On the first page of the wizard enter the location of the remote repository:
  
 
[[Image:02-GitProtocol.png]]
 
[[Image:02-GitProtocol.png]]
  
* '''URI'''  - The complete URI of the remote repository or the path on the filesystem. This field is automatically synchronized with the other fields.
+
* '''URI'''  - The complete URI of the remote repository or the path on the file system. This field is automatically synchronized with the other fields.
* '''Host''' -  The name of the remote host or empty if cloning from the filesystem.
+
* '''Host''' -  The name of the remote host or empty if cloning from the file system.
* '''Repository Path''' - Path to the remote repository or on the filesystem.
+
* '''Repository Path''' - Path to the remote repository or on the file system.
 
* '''Protocol''' - One of the protocols described below.
 
* '''Protocol''' - One of the protocols described below.
* '''Port''' - Http Port
+
* '''Port''' - Port number.
* '''User''' - The username used for authentication.
+
* '''User''' - The user name used for authentication.
* '''Password''' The password used for autentication.
+
* '''Password''' The password used for authentication.
  
 
The following protocols are supported:
 
The following protocols are supported:
* '''git''' - The fast, read only git protocol.
+
* '''git''' - The most efficient built-in git protocol (default port 9418). This protocol doesn't provide authentication. Typically used for anonymous read access to the repository.
* '''git+ssh''' - Git over secure shell. Use this protocol if you want to push back to the repository.
+
* '''git+ssh''' - Git over [http://tools.ietf.org/html/rfc4251 secure shell (SSH)] protocol. Typically used for authenticated write access to the repository.
* '''sftp'''
+
* '''sftp''' - [http://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol SSH File Transfer Protocol]
* '''http''' - Read-only, working behind most firewalls.
+
* '''http''' - [http://tools.ietf.org/html/rfc2616 Hypertext Transfer Protocol] can be tunneled through firewalls.
* '''https'''  
+
* '''https''' - [http://tools.ietf.org/html/rfc2818 Hypertext Transfer Protocol Secure] can be tunneled through firewalls.
* '''ftp'''
+
* '''ftp''' - [http://tools.ietf.org/html/rfc959 File Transfer Protocol]
 
* '''file''' - File system access to the repository.
 
* '''file''' - File system access to the repository.
  
 
=== Branch selection ===
 
=== Branch selection ===
  
On the next page you can choose which branch should be cloned from the remote repository:
+
On the next page choose which branch should be cloned from the remote repository:
  
 
[[Image:05-branches.png]]
 
[[Image:05-branches.png]]
Line 42: Line 41:
 
=== Local Destination ===
 
=== Local Destination ===
  
You can define where you want to store the repository on your file system and already define some initial settings.
+
On the next page define where you want to store the repository on your file system and define some initial settings.
  
 
[[Image:06-LocalStorage.png]]
 
[[Image:06-LocalStorage.png]]
Line 55: Line 54:
 
=== Import Projects ===
 
=== Import Projects ===
  
The found projects are presented on the next page.
+
On the next page the Eclipse projects found in the cloned repository are presented.
  
 
[[Image:07-ImportProjects.png]]
 
[[Image:07-ImportProjects.png]]
  
* '''Enable Git Team operations on imported projects''' - If this checkbox is selected the imported project are shared with the EGit Team provider. If it is not checked, the Team operations can still be enabled if you choose the project in eclipse and select Team -> Share Project...
+
* '''Enable Git Team operations on imported projects''' - If this checkbox is selected the imported project are shared with the EGit Team provider. If it is not checked, the Team operations can still be enabled later on by choosing the project in eclipse and selecting Team -> Share Project...
 +
 
 +
== Pushing a Local Repository to GitHub ==
 +
 
 +
=== Create Local Repository ===
 +
* follow [[EGit/User Guide/Getting Started]] to create a new local repository (with your content instead of the demo project)
 +
 
 +
=== Create Repository at GitHub ===
 +
* create a new repository at GitHub
 +
[[Image:egit-0.6-001-CreateRepoAtGithub.png]]
 +
* you get a fresh clone URL for this new repository
 +
[[Image:egit-0.6-002-CloneUrl.png]]
 +
 
 +
=== Eclipse SSH Configuration ===
 +
* open "Window" > "Preferences" and ensure that your SSH2 home is configured correctly (usually this is ~/.ssh) and contains your SSH2 keys (upload your public key to your GitHub account settings)
 +
[[Image:egit-0.6-003-SshPreferences.png]]
 +
* if you don't have SSH keys yet you may generate them on the second tab "Key Management" of this dialog, use a good pass phrase to protect your private key, for more details see [http://help.github.com/working-with-key-passphrases/ "working with key passphrases"]
 +
 
 +
=== Push Upstream ===
 +
* Select your new Eclipse project and click "Team" > "Push To" and enter "Your GitHub Clone URL" and your GitHub password(with the free github accoutns do not enter a password but leave blank), leave the user as "git"
 +
[[Image:egit-0.6-004-PushDialog.png]]
 +
* click "Next" and on first connection accept GitHub's host key
 +
[[Image:egit-0.6-005-AcceptHostKey.png]]
 +
* enter your SSH key's passphrase
 +
[[Image:egit-0.6-006-PassPhrase.png]]
 +
* enter as source ref: refs/heads/master and as target ref: refs/heads/master and click button "Add all branches spec"
 +
[[Image:egit-0.6-007-PushRefSpecifications.png]]
 +
* click "Next" and click "Finish" to confirm the push
 +
[[Image:egit-0.6-008-PushConfirmation.png]]
 +
* the next dialog shows the result of the push operation
 +
[[Image:egit-0.6-009-PushResult.png]]
 +
* point your browser at your GitHub repository to see that your new repository content has arrived
 +
[[Image:egit-0.6-010-PushResultOnGithub.png]]
 +
 
 +
[[Category:Draft Documentation]]
 +
 
 +
== Pulling (merge or rebase) new changes from upstream ==
 +
 
 +
This is not yet available.  Available alternatives currently include:
 +
* run "git pull" from outside eclipse (but [http://marc.info/?l=git&m=123924844219075 beware on Windows])
 +
* if you did no local change or want to discard your local changes, use "Team/Reset To..."

Latest revision as of 10:37, 21 May 2010

EGit
Website
Download
Community
Mailing ListForumsIRC
Bugzilla
Open
Help Wanted
Bug Day
Contribute
Browse SourceProject Set File

Working with remote Repositories

Cloning remote Repositories

Using the Git import wizard you can clone remote repositories using different transport protocols. Additionally you may import existing Eclipse projects into your workspace and share the projects with the Git team provider.

Start the import wizard by navigating to File -> Import... and choose "Git Repository".

Repository Selection

On the first page of the wizard enter the location of the remote repository:

02-GitProtocol.png

  • URI - The complete URI of the remote repository or the path on the file system. This field is automatically synchronized with the other fields.
  • Host - The name of the remote host or empty if cloning from the file system.
  • Repository Path - Path to the remote repository or on the file system.
  • Protocol - One of the protocols described below.
  • Port - Port number.
  • User - The user name used for authentication.
  • Password The password used for authentication.

The following protocols are supported:

Branch selection

On the next page choose which branch should be cloned from the remote repository:

05-branches.png

Local Destination

On the next page define where you want to store the repository on your file system and define some initial settings.

06-LocalStorage.png

  • Directory - The directory which will contain the Git repository. It will be created by the wizard if it does not yet exist.
  • Initial branch - Choose here which local branch will be created and checked out.
  • Remote name - Define a name for the remote repository. The default is "origin".
  • Import projects after clone - If checked, the repository is searched for eclipse projects. In this case the finish button is disabled and the wizard continues with the project selection. If not checked, the finish button is enabled.

Note that if you press "Next" on this page the repository will immediately be cloned by the wizard. This is necessary to find the eclipse projects. If you end the wizard with the "Cancel" button later on you will be asked if the clone should be deleted.

Import Projects

On the next page the Eclipse projects found in the cloned repository are presented.

07-ImportProjects.png

  • Enable Git Team operations on imported projects - If this checkbox is selected the imported project are shared with the EGit Team provider. If it is not checked, the Team operations can still be enabled later on by choosing the project in eclipse and selecting Team -> Share Project...

Pushing a Local Repository to GitHub

Create Local Repository

Create Repository at GitHub

  • create a new repository at GitHub

Egit-0.6-001-CreateRepoAtGithub.png

  • you get a fresh clone URL for this new repository

Egit-0.6-002-CloneUrl.png

Eclipse SSH Configuration

  • open "Window" > "Preferences" and ensure that your SSH2 home is configured correctly (usually this is ~/.ssh) and contains your SSH2 keys (upload your public key to your GitHub account settings)

Egit-0.6-003-SshPreferences.png

  • if you don't have SSH keys yet you may generate them on the second tab "Key Management" of this dialog, use a good pass phrase to protect your private key, for more details see "working with key passphrases"

Push Upstream

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

Egit-0.6-004-PushDialog.png

  • click "Next" and on first connection accept GitHub's host key

Egit-0.6-005-AcceptHostKey.png

  • enter your SSH key's passphrase

Egit-0.6-006-PassPhrase.png

  • enter as source ref: refs/heads/master and as target ref: refs/heads/master and click button "Add all branches spec"

Egit-0.6-007-PushRefSpecifications.png

  • click "Next" and click "Finish" to confirm the push

Egit-0.6-008-PushConfirmation.png

  • the next dialog shows the result of the push operation

Egit-0.6-009-PushResult.png

  • point your browser at your GitHub repository to see that your new repository content has arrived

Egit-0.6-010-PushResultOnGithub.png

Pulling (merge or rebase) new changes from upstream

This is not yet available. Available alternatives currently include:

  • run "git pull" from outside eclipse (but beware on Windows)
  • if you did no local change or want to discard your local changes, use "Team/Reset To..."