Cloning an Existing Repository

How can I work with an existing Git repository from a remote server?

Cloning an Existing Repository

In this video, I’ll show you how to get on board of an existing project. By downloading (or cloning) a copy of an existing repository from a server.

A URL to a remote repository can take many forms: the first two examples use the popular SSH protocol; just as common are URLs using HTTP or HTTPS; less often, you’ll see the special “git” protocol.

No matter which type of URL you have, simply enter it in Tower’s “Clone” dialog.

Next, you should add any necessary authentication credentials. And last, you need to choose where on your local hard drive you want to have the project downloaded. To make this easier, you can configure a “default cloning directory” in Tower’s settings. If you have something like a “development” or “project” folder, this will be your proposed default location in this dialog.

Now this is all well and good, but it can be even easier: Tower offers special integrations for a couple of hosting services. So, if you’re using a service like GitHub, Bitbucket, or Beanstalk, the process is even more comfortable.
First, go to the “Services” area in Tower. There, you can connect your account with Tower.

You’ll then have a listing of all repositories in this account right in Tower. You can then clone a repsitory with just a click - without having to enter credentials or URLs anymore. You can even create new repositories in your account right from within Tower.

When cloning a repository, Tower will download the project in the background. You can track the progress in the “Cloning Queue”. As soon as the cloning is done, you’ll have a new item in the “Repositories” view.

Just out of curiosity: let’s take a look at the situation in a file browser. You’ll see two things:

  • A new folder has been created that contains the project’s working files
  • And, if you’ve configured to show hidden files, you’ll also see a “.git” folder. This is the local Git repository - which contains the full history of the project; every version of every file. Everything is right at hand.

This is it for now. Thanks for watching - and see you soon in our next videos.