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=
"Starting-from-existing-Git-Repositories.html" title=
"Starting from existing Git Repositories">
16 <img alt=
"Previous" border=
"0" src=
"../../images/prev.gif"/>
19 <td style=
"width: 60%" align=
"center"></td>
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">Starting from existing Git Repositories
</td>
28 <td style=
"width: 60%" align=
"center"></td>
29 <td style=
"width: 20%" align=
"right" valign=
"top">Inspecting the state of the Repository
</td>
32 <h1 id=
"Working_with_remote_Repositories">Working with remote Repositories
</h1>
33 <h2 id=
"Cloning_remote_Repositories">Cloning remote Repositories
</h2>
34 <p>Using the Git clone wizard you may clone remote repositories using different transport protocols.
</p>
35 <p>The wizard can be started from the
"Import Projects from Git" wizard using
</p>
36 <pre>Import... -
> Git -
> Projects from Git -
> Next -
> Clone...
38 <p>or from the
"Git Repositories View" (described elsewhere) using the
"Clone a Git Repository" toolbar button.
</p>
39 <h3 id=
"Repository_Selection">Repository Selection
</h3>
40 <p>On the first page of the wizard enter the location of the remote repository:
</p>
42 <img border=
"0" src=
"images/02-GitProtocol.png"/>
46 <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.
47 <br/>Note that you can use the
"Local file..." button to browse for a local directory and that the URI field offers content assist by offering previously used values
50 <b>Host
</b> - The name of the remote host or empty if cloning from the file system.
53 <b>Repository Path
</b> - Path to the remote repository or on the file system.
56 <b>Protocol
</b> - One of the protocols described below.
59 <b>Port
</b> - Port number.
62 <b>User
</b> - The user name used for authentication.
65 <b>Password
</b> The password used for authentication.
68 <p>The following protocols are supported:
</p>
71 <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.
74 <b>git+ssh
</b> - Git over
75 <a href=
"http://tools.ietf.org/html/rfc4251" target=
"egit_external">secure shell (SSH)
</a> protocol. Typically used for authenticated write access to the repository.
79 <a href=
"http://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol" target=
"egit_external">SSH File Transfer Protocol
</a>
83 <a href=
"http://tools.ietf.org/html/rfc2616" target=
"egit_external">Hypertext Transfer Protocol
</a> can be tunneled through firewalls.
87 <a href=
"http://tools.ietf.org/html/rfc2818" target=
"egit_external">Hypertext Transfer Protocol Secure
</a> can be tunneled through firewalls.
91 <a href=
"http://tools.ietf.org/html/rfc959" target=
"egit_external">File Transfer Protocol
</a>
94 <b>file
</b> - File system access to the repository.
97 <h3 id=
"Branch_selection">Branch selection
</h3>
98 <p>On the next page choose which branch should be cloned from the remote repository:
</p>
100 <img border=
"0" src=
"images/05-branches.png"/>
102 <h3 id=
"Local_Destination">Local Destination
</h3>
103 <p>On the next page define where you want to store the repository on the local file system and define some initial settings.
</p>
105 <img border=
"0" src=
"images/06-LocalStorage.png"/>
109 <b>Directory
</b> - The directory which will contain the Git repository. It will be created by the wizard if it does not yet exist.
112 <b>Initial branch
</b> - Choose here which local branch will be created and initially checked out.
115 <b>Remote name
</b> - Define a name for the remote repository. The default is
"origin".
118 <h2 id=
"Pushing_to_other_Repositories">Pushing to other Repositories
</h2>
120 <h3 id=
"Pushing_a_Local_Repository_to_GitHub">Pushing a Local Repository to GitHub
</h3>
121 <h4 id=
"Create_Local_Repository">Create Local Repository
</h4>
124 <a href=
"http://wiki.eclipse.org/EGit/User_Guide/Getting_Started" title=
"EGit/User Guide/Getting Started" target=
"egit_external">EGit/User Guide/Getting Started
</a> to create a new local repository (with your content instead of the demo project)
127 <h4 id=
"Create_Repository_at_GitHub">Create Repository at GitHub
</h4>
129 <li>create a new repository at GitHub
</li>
132 <img border=
"0" src=
"images/Egit-0.6-001-CreateRepoAtGithub.png"/>
135 <li>you get a fresh clone URL for this new repository
</li>
138 <img border=
"0" src=
"images/Egit-0.6-002-CloneUrl.png"/>
140 <h4 id=
"Eclipse_SSH_Configuration">Eclipse SSH Configuration
</h4>
142 <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>
145 <img border=
"0" src=
"images/Egit-0.6-003-SshPreferences.png"/>
148 <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
149 <a href=
"http://help.github.com/working-with-key-passphrases/" target=
"egit_external">"working with key passphrases"</a>
152 <h4 id=
"Push_Upstream">Push Upstream
</h4>
154 <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>
157 <img border=
"0" src=
"images/Egit-0.6-004-PushDialog.png"/>
160 <li>click
"Next" and on first connection accept GitHub's host key
</li>
163 <img border=
"0" src=
"images/Egit-0.6-005-AcceptHostKey.png"/>
166 <li>enter your SSH key's passphrase
</li>
169 <img border=
"0" src=
"images/Egit-0.6-006-PassPhrase.png"/>
172 <li>click button
"Add all branches spec"</li>
175 <img border=
"0" src=
"images/Egit-0.6-007-PushRefSpecifications.png"/>
178 <li>click
"Next" and click
"Finish" to confirm the push
</li>
181 <img border=
"0" src=
"images/Egit-0.6-008-PushConfirmation.png"/>
184 <li>the next dialog shows the result of the push operation
</li>
187 <img border=
"0" src=
"images/Egit-0.6-009-PushResult.png"/>
190 <li>point your browser at your GitHub repository to see that your new repository content has arrived
</li>
193 <img border=
"0" src=
"images/Egit-0.6-010-PushResultOnGithub.png"/>
195 <h2 id=
"Fetching_from_other_Repositories">Fetching from other Repositories
</h2>
197 <h2 id=
"Pulling_.28merge_or_rebase.29_new_changes_from_Upstream_Repositories">Pulling (merge or rebase) new changes from Upstream Repositories
</h2>
198 <p>This is not yet available. Available alternatives currently include:
</p>
200 <li>run
"git pull" from outside eclipse (but
201 <a href=
"http://marc.info/?l=git&m=123924844219075" target=
"egit_external">beware on Windows
</a>)
203 <li>if you did no local change or want to discard your local changes, use
"Team/Reset To..."</li>
205 <table class=
"navigation" style=
"width: 100%;" border=
"0" summary=
"navigation">
207 <td style=
"width: 20%" align=
"left">
208 <a href=
"Starting-from-existing-Git-Repositories.html" title=
"Starting from existing Git Repositories">
209 <img alt=
"Previous" border=
"0" src=
"../../images/prev.gif"/>
212 <td style=
"width: 60%" align=
"center">
213 <a href=
"User-Guide.html" title=
"EGit User Guide">
214 <img alt=
"EGit User Guide" border=
"0" src=
"../../images/home.gif"/>
217 <td style=
"width: 20%" align=
"right">
218 <a href=
"Inspecting-the-state-of-the-Repository.html" title=
"Inspecting the state of the Repository">
219 <img alt=
"Next" border=
"0" src=
"../../images/next.gif"/>
224 <td style=
"width: 20%" align=
"left" valign=
"top">Starting from existing Git Repositories
</td>
225 <td style=
"width: 60%" align=
"center"></td>
226 <td style=
"width: 20%" align=
"right" valign=
"top">Inspecting the state of the Repository
</td>