How to Clone a Repository on Github

Git is a very common tool in collaborative software development. Cloning a repository locally stores the latest changes of a project, allowing you to branch off and make your own edits without immediately affecting someone else's work. To...
Method 1 of 3:

Using the Command Line

  1. How to Clone a Repository on Github Picture 1How to Clone a Repository on Github Picture 1
    Download and install Git. Go to https://git-scm.com/downloads and select the download for the platform you are using.
  2. How to Clone a Repository on Github Picture 2How to Clone a Repository on Github Picture 2
    Create a directory for your repository. Navigate to a location of your choosing your computer. Then right-click (or Ctrl + click) and select 'New Folder'.
    1. For simplicity, it may be best to create your first repository folder on the Desktop.
  3. How to Clone a Repository on Github Picture 3How to Clone a Repository on Github Picture 3
    Open Git CMD. This program is installed along with the git tools, however you can also use the natively installed Command Prompt (Windows) or Terminal (Mac/Linux).
  4. How to Clone a Repository on Github Picture 4How to Clone a Repository on Github Picture 4
    Navigate to your target directory in the command line. Enter the 'cd' command following by the path to the repository folder you created. Folders in the path are separated by ''. Hit Enter to complete the action.
    1. For example, a folder on the desktop for Windows would use the command 'cd c:users[username]desktop[foldername]'
    2. 'cd' stands for 'change directory'
    3. You can change directories one at a time instead of all at once if you find it faster to type: 'cd desktop' Enter 'cd folder name' Enter.
  5. How to Clone a Repository on Github Picture 5How to Clone a Repository on Github Picture 5
    Navigate to the repository page in your web browser. Go to the github (or whichever git alternative) page of the repository you are trying to clone. The source location of the repository will be displayed on the repository page.
    1. The exact location of the source location will vary depending on which repository site you are using, but they are usually located near the top for easy access. Look for a URL.
  6. How to Clone a Repository on Github Picture 6How to Clone a Repository on Github Picture 6
    Copy the source location. Click the source location (typically a URL starting with 'https' or 'ssh') and hit Ctrl+C or Cmd+C to copy.
  7. How to Clone a Repository on Github Picture 7How to Clone a Repository on Github Picture 7
    Enter 'git clone' followed by the source location into the command line. The 'git' command tells the command line you are using a Git function, and 'clone' tells it to clone the location following the command. Paste or type out the source location after the command.
    1. In order to paste into the Windows command line, you have to right-click and select 'Paste' from the context menu. This is not necessary in the Mac or Linux Terminal.
  8. How to Clone a Repository on Github Picture 8How to Clone a Repository on Github Picture 8
    Hit Enter. The cloning process will begin and display its progress in the command line. You will be notified when the process in completed by a message in the command line.
Method 2 of 3:

Using the Git GUI

  1. How to Clone a Repository on Github Picture 9How to Clone a Repository on Github Picture 9
    Download and install Git. Go to https://git-scm.com/downloads and select the download for the platform you are using.
  2. How to Clone a Repository on Github Picture 10How to Clone a Repository on Github Picture 10
    Create a directory for your repository. Navigate to a location of your choosing your computer. Then right-click (or Ctrl + click) and select 'New Folder'.
    1. For simplicity, it may be best to create your first repository folder on the Desktop.
  3. How to Clone a Repository on Github Picture 11How to Clone a Repository on Github Picture 11
    Navigate to the repository page in your web browser. Go to the github (or whichever git product) page of the repository you are trying to clone. The source location of the repository will be displayed on the repository page.
    1. The exact location of the source location will vary depending on which repository site you are using, but they are usually located near the top for easy access. Look for a URL.
  4. How to Clone a Repository on Github Picture 12How to Clone a Repository on Github Picture 12
    Copy the source location. Click the source location (typically a URL starting with 'https' or 'ssh') and hit Ctrl+C or Cmd+C to copy.
  5. How to Clone a Repository on Github Picture 13How to Clone a Repository on Github Picture 13
    Open Git GUI. This program is installed along with the git tools. Instead of booting into a text command line, you will see a window with clickable buttons
  6. How to Clone a Repository on Github Picture 14How to Clone a Repository on Github Picture 14
    Click 'Clone Repository'. This is the first option on the boot splash screen.
    1. You can also select 'Clone' from 'Repository' dropdown menu.
  7. How to Clone a Repository on Github Picture 15How to Clone a Repository on Github Picture 15
    Enter the source location. Paste or type the source location into this field.
  8. How to Clone a Repository on Github Picture 16How to Clone a Repository on Github Picture 16
    Enter target directory. Enter the path to the repository folder you created.
    1. You can also click 'Browse' to search for the folder without having to type it out.
  9. How to Clone a Repository on Github Picture 17How to Clone a Repository on Github Picture 17
    Click 'Clone'. The GUI will display your progress and notify you once the clone is complete.
Method 3 of 3:

Using Visual Studio

  1. How to Clone a Repository on Github Picture 18How to Clone a Repository on Github Picture 18
    Navigate to the repository page in your web browser. Go to the github (or whichever git product) page of the repository you are trying to clone. The source location of the repository will be displayed on the repository page.
    1. The exact location of the source location will vary depending on which repository site you are using, but they are usually located near the top for easy access. Look for a URL.
  2. How to Clone a Repository on Github Picture 19How to Clone a Repository on Github Picture 19
    Copy the source location. Click the source location (typically a URL starting with 'https' or 'ssh') and hit Ctrl+C or Cmd+C to copy.
  3. How to Clone a Repository on Github Picture 20How to Clone a Repository on Github Picture 20
    Open Visual Studio. Visual Studio is common in Windows development environments, but is not free. You can download VS Express to get a stripped down free edition.
  4. How to Clone a Repository on Github Picture 21How to Clone a Repository on Github Picture 21
    Select the 'Team Explorer' tab. This is located in the bottom of right-hand sidebar.
  5. How to Clone a Repository on Github Picture 22How to Clone a Repository on Github Picture 22
    Click the 'Manage Connections' button. This button is represented by the plug icon and is located in the top menu bar of the right sidebar.
  6. How to Clone a Repository on Github Picture 23How to Clone a Repository on Github Picture 23
    Click 'Clone'. This is located in the 'Local git repositories' section in the right sidebar.
  7. How to Clone a Repository on Github Picture 24How to Clone a Repository on Github Picture 24
    Enter or paste the source location into the text field. Once in the field, the 'Clone' action button will become clickable.
  8. How to Clone a Repository on Github Picture 25How to Clone a Repository on Github Picture 25
    Click 'Clone'. This button is located below the source location field. Once clicked a progress bar will appear displaying the clone process. The process is complete once the bar is filled.
    1. Cloned repositories are automatically cloned to a local directory in your visual studio directory.[2]
4 ★ | 2 Vote