Cloning an existing Git repository

Quite often, you'll want to clone existing code to work on it. In fact, this is probably something you are going to do more often than creating a new repository. Much like developers, DevOps engineers spend more time collaborating on existing code rather than creating brand new code.

Getting ready

For this recipe, you need either a Red Hat- or Debian-based Linux host with a Git client installed.

How to do it…

Let's start cloning an existing repository:

  1. Change your directory into the one you want to clone the existing project into.
  2. Use the git clone command to clone your chosen repository:
    $ git clone <GIT URL>
    

    This should give you an output similar to the following screenshot:

  3. Once it's cloned, you can pull any changes ...

Get Learning DevOps: Continuously Deliver Better Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.