1 <?xml version=
"1.0" encoding=
"utf-8"?><!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns=
"http://www.w3.org/1999/xhtml">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
5 <title>EGit User Guide - Working with remote Repositories
</title>
6 <link type=
"text/css" rel=
"stylesheet" href=
"book.css" />
9 <table class=
"navigation" style=
"width: 100%;" border=
"0" summary=
"navigation">
11 <th style=
"width: 100%" align=
"center" colspan=
"3">Working with remote Repositories
</th>
14 <td style=
"width: 20%" align=
"left">
15 <a href=
"Creating-a-new-empty-Git-Repository.html" title=
"Creating a new empty Git Repository">
16 <img alt=
"Previous" border=
"0" src=
"images/prev.gif" />
19 <td style=
"width: 60%" align=
"center" />
20 <td style=
"width: 20%" align=
"right">
21 <a href=
"Inspecting-the-state-of-the-Repository.html" title=
"Inspecting the state of the Repository">
22 <img alt=
"Next" border=
"0" src=
"images/next.gif" />
27 <td style=
"width: 20%" align=
"left" valign=
"top">Creating a new empty Git Repository
</td>
28 <td style=
"width: 60%" align=
"center" />
29 <td style=
"width: 20%" align=
"right" valign=
"top">Inspecting the state of the Repository
</td>
33 <h1 id=
"Working_with_remote_Repositories">Working with remote Repositories
</h1>
34 <h2 id=
"Cloning_remote_Repositories">Cloning remote Repositories
</h2>
35 <p>Using the Git import wizard you can clone remote repositories using different transport protocols.
36 Additionally you may import existing Eclipse projects into your workspace and share the projects with the Git team provider.
</p>
37 <p>Start the import wizard by navigating to File -
> Import... and choose
"Git Repository".
</p>
39 <img border=
"0" src=
"images/01-CloneExistingRepository.png" />
41 <h3 id=
"Repository_Selection">Repository Selection
</h3>
42 <p>On the first page of the wizard enter the location of the remote repository:
</p>
44 <img border=
"0" src=
"images/02-GitProtocol.png" />
48 <b>URI
</b> - The complete URI of the remote repository or the path on the file system. This field is automatically synchronized with the other fields.
51 <b>Host
</b> - The name of the remote host or empty if cloning from the file system.
54 <b>Repository Path
</b> - Path to the remote repository or on the file system.
57 <b>Protocol
</b> - One of the protocols described below.
60 <b>Port
</b> - Port number.
63 <b>User
</b> - The user name used for authentication.
66 <b>Password
</b> The password used for authentication.
69 <p>The following protocols are supported:
</p>
72 <b>git
</b> - 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.
75 <b>git+ssh
</b> - Git over
76 <a href=
"http://tools.ietf.org/html/rfc4251" target=
"mylyn_external">secure shell (SSH)
</a> protocol. Typically used for authenticated write access to the repository.
80 <a href=
"http://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol" target=
"mylyn_external">SSH File Transfer Protocol
</a>
84 <a href=
"http://tools.ietf.org/html/rfc2616" target=
"mylyn_external">Hypertext Transfer Protocol
</a> can be tunneled through firewalls.
88 <a href=
"http://tools.ietf.org/html/rfc2818" target=
"mylyn_external">Hypertext Transfer Protocol Secure
</a> can be tunneled through firewalls.
92 <a href=
"http://tools.ietf.org/html/rfc959" target=
"mylyn_external">File Transfer Protocol
</a>
95 <b>file
</b> - File system access to the repository.
98 <h3 id=
"Branch_selection">Branch selection
</h3>
99 <p>On the next page choose which branch should be cloned from the remote repository:
</p>
101 <img border=
"0" src=
"images/05-branches.png" />
103 <h3 id=
"Local_Destination">Local Destination
</h3>
104 <p>On the next page define where you want to store the repository on your file system and define some initial settings.
</p>
106 <img border=
"0" src=
"images/06-LocalStorage.png" />
110 <b>Directory
</b> - The directory which will contain the Git repository. It will be created by the wizard if it does not yet exist.
113 <b>Initial branch
</b> - Choose here which local branch will be created and checked out.
116 <b>Remote name
</b> - Define a name for the remote repository. The default is
"origin".
119 <b>Import projects after clone
</b> - 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.
122 <p>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.
</p>
123 <h3 id=
"Import_Projects">Import Projects
</h3>
124 <p>On the next page the Eclipse projects found in the cloned repository are presented.
</p>
126 <img border=
"0" src=
"images/07-ImportProjects.png" />
130 <b>Enable Git Team operations on imported projects
</b> - 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...
133 <h2 id=
"Pushing_a_Local_Repository_to_GitHub">Pushing a Local Repository to GitHub
</h2>
134 <h3 id=
"Create_Local_Repository">Create Local Repository
</h3>
137 <a href=
"http://wiki.eclipse.org/EGit/User_Guide/Getting_Started" title=
"EGit/User Guide/Getting Started" target=
"mylyn_external">EGit/User Guide/Getting Started
</a> to create a new local repository (with your content instead of the demo project)
140 <h3 id=
"Create_Repository_at_GitHub">Create Repository at GitHub
</h3>
142 <li>create a new repository at GitHub
</li>
145 <img border=
"0" src=
"images/Egit-0.6-001-CreateRepoAtGithub.png" />
148 <li>you get a fresh clone URL for this new repository
</li>
151 <img border=
"0" src=
"images/Egit-0.6-002-CloneUrl.png" />
153 <h3 id=
"Eclipse_SSH_Configuration">Eclipse SSH Configuration
</h3>
155 <li>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)
</li>
158 <img border=
"0" src=
"images/Egit-0.6-003-SshPreferences.png" />
161 <li>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
162 <a href=
"http://help.github.com/working-with-key-passphrases/" target=
"mylyn_external">"working with key passphrases"</a>
165 <h3 id=
"Push_Upstream">Push Upstream
</h3>
167 <li>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"</li>
170 <img border=
"0" src=
"images/Egit-0.6-004-PushDialog.png" />
173 <li>click
"Next" and on first connection accept GitHub's host key
</li>
176 <img border=
"0" src=
"images/Egit-0.6-005-AcceptHostKey.png" />
179 <li>enter your SSH key's passphrase
</li>
182 <img border=
"0" src=
"images/Egit-0.6-006-PassPhrase.png" />
185 <li>enter as source ref: refs/heads/master and as target ref: refs/heads/master and click button
"Add all branches spec"</li>
188 <img border=
"0" src=
"images/Egit-0.6-007-PushRefSpecifications.png" />
191 <li>click
"Next" and click
"Finish" to confirm the push
</li>
194 <img border=
"0" src=
"images/Egit-0.6-008-PushConfirmation.png" />
197 <li>the next dialog shows the result of the push operation
</li>
200 <img border=
"0" src=
"images/Egit-0.6-009-PushResult.png" />
203 <li>point your browser at your GitHub repository to see that your new repository content has arrived
</li>
206 <img border=
"0" src=
"images/Egit-0.6-010-PushResultOnGithub.png" />
208 <h2 id=
"Pulling_.28merge_or_rebase.29_new_changes_from_upstream">Pulling (merge or rebase) new changes from upstream
</h2>
209 <p>This is not yet available. Available alternatives currently include:
</p>
211 <li>run
"git pull" from outside eclipse (but
212 <a href=
"http://marc.info/?l=git&m=123924844219075" target=
"mylyn_external">beware on Windows
</a>)
214 <li>if you did no local change or want to discard your local changes, use
"Team/Reset To..."</li>
217 <table class=
"navigation" style=
"width: 100%;" border=
"0" summary=
"navigation">
219 <td style=
"width: 20%" align=
"left">
220 <a href=
"Creating-a-new-empty-Git-Repository.html" title=
"Creating a new empty Git Repository">
221 <img alt=
"Previous" border=
"0" src=
"images/prev.gif" />
224 <td style=
"width: 60%" align=
"center">
225 <a href=
"EGit User Guide.html" title=
"EGit User Guide">
226 <img alt=
"EGit User Guide" border=
"0" src=
"images/home.gif" />
229 <td style=
"width: 20%" align=
"right">
230 <a href=
"Inspecting-the-state-of-the-Repository.html" title=
"Inspecting the state of the Repository">
231 <img alt=
"Next" border=
"0" src=
"images/next.gif" />
236 <td style=
"width: 20%" align=
"left" valign=
"top">Creating a new empty Git Repository
</td>
237 <td style=
"width: 60%" align=
"center" />
238 <td style=
"width: 20%" align=
"right" valign=
"top">Inspecting the state of the Repository
</td>