Skip to main content
Skip to content

Connecting to your code locally

Connect GitHub Desktop to your account and clone your repository to edit files locally.

So far, you've worked in the browser. In this tutorial, you'll use GitHub Desktop to clone your repository to your computer so you can edit files in your own code editor.

Note

As you follow this series, if you use GitHub Enterprise Cloud with data residency or GitHub Enterprise Server, you will need to substitute references and links to GitHub.com with your enterprise's dedicated URL.

Prerequisites

Installing GitHub Desktop

If you don't have GitHub Desktop yet, install it before you continue. Download GitHub Desktop.

Tip

GitHub Docs contains documentation for all of GitHub's plans, and where relevant, tools and operating systems. To find content that matches your setup, use the Version dropdown in the top left corner of an article to select your plan, and select the tool or operating system tabs below the article's introduction.

Signing in to GitHub Desktop

Sign in so that GitHub Desktop can access your repositories.

  1. Open GitHub Desktop.
  2. From the welcome screen, click Sign in to GitHub Enterprise.
  3. Follow the prompts to authenticate with your GitHub account and authorize the app.
  4. Follow the steps to configure Git with your name and email address, which will be used for commits you make in GitHub Desktop.

If you don't see the welcome screen, follow the steps in Configuring basic settings in GitHub Desktop to sign in and manage your settings from the GitHub Desktop menu.

Cloning your repository

Cloning creates a copy of your repository on your computer that stays connected to the version on GitHub.

  1. From the "Let's get started!" screen, select stargazers-log from the list of "Your repositories".
  2. Directly below the repositories list, click Clone OWNER/stargazers-log, where OWNER is your GitHub personal account.
  3. Accept the default repository URL and local path, and click Clone.

If you don't see the "Let's get started!" screen, follow the steps in Cloning a repository to clone your stargazers-log repository.

Using the command line instead

This series uses GitHub Desktop, but you can also clone your repository with Git in the terminal. If you haven't installed Git yet, see Set up Git.

  1. On GitHub, navigate to the main page of your stargazers-log repository.

  2. Above the list of files, click Code, then copy the HTTPS URL.

  3. In the terminal, change to the directory where you want to store your project, then enter the following command. Replace REPOSITORY-URL with the URL you copied.

    Shell
    git clone REPOSITORY-URL
    

For more information, see Cloning a repository.

If you only want a copy of a repository's files, without connecting it to GitHub, you can download the files instead. See Downloading files from GitHub.

Opening your code in an editor

With your repository cloned, open it in a code editor to start working on the files.

  1. In GitHub Desktop, select Repository, then click Open in EDITOR.

    • If you haven't set an editor yet, install one such as Visual Studio Code (VS Code), then choose it in the Advanced section of GitHub Desktop settings.
  2. Confirm that you can see your index.html and README.md files in the editor.

What you accomplished

TaskOutcome
Signed in to GitHub DesktopYou connected GitHub Desktop to your account.
Cloned your repositoryYou created a local copy of stargazers-log on your computer.
Opened your codeYou opened the website files in a code editor, ready to make changes.

Next steps