Cloning a remote repository

We have learned how to start development using a local Git repository and then push changes to a remote repository. Let's now learn how we can get an existing remote Git repository and create a local copy; in other words, we will learn how to clone a remote Git repository. The easiest option is to import the remote Git project. Select File | Import... from the main menu and then Git | Projects from Git | Clone URI.

The wizard will display a page similar to Figure 3.29. Enter the URI of the remote repository, username, and password, and then click Next. Select a remote branch and click Next:

Figure 3.34: Selecting a remote branch to clone

Click the Next button in the branch selection page:

Figure 3.35: Selecting the location of the cloned project

Select the location where the project is to be saved and click Next:

Figure 3.36: Options to import the cloned project

There are three options to import the cloned project. If the remote repository contains the entire Eclipse project, then select Import existing Eclipse projects, or else select either of the remaining two options. Since we have checked in the Eclipse project in the remote repository, we will select the first option. Click Next and then Finish.


For more information about the Eclipse Git plugin, refer to https://wiki.eclipse.org/EGit/User_Guide.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.42.176