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.
注意
As you follow this series, if you use 带有数据驻留权的 GitHub Enterprise Cloud or GitHub Enterprise Server, you will need to substitute references and links to GitHub.com with your enterprise's dedicated URL.
Prerequisites
- A
stargazers-logrepository. If you haven't created it yet, see Creating a repository for your project on GitHub. - GitHub Desktop installed on your computer.
Installing GitHub Desktop
If you don't have GitHub Desktop yet, install it before you continue. Download GitHub Desktop.
提示
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.
- Open GitHub Desktop.
- From the welcome screen, click Sign in to GitHub Enterprise.
- Follow the prompts to authenticate with your GitHub account and authorize the app.
- 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 在 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.
- From the "Let's get started!" screen, select
stargazers-logfrom the list of "Your repositories". - Directly below the repositories list, click Clone OWNER/stargazers-log, where OWNER is your GitHub personal account.
- 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.
Opening your code in an editor
With your repository cloned, open it in a code editor to start working on the files.
-
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.
-
Confirm that you can see your
index.htmlandREADME.mdfiles in the editor.
What you accomplished
| Task | Outcome |
|---|---|
| Signed in to GitHub Desktop | You connected GitHub Desktop to your account. |
| Cloned your repository | You created a local copy of stargazers-log on your computer. |
| Opened your code | You opened the website files in a code editor, ready to make changes. |
Next steps
- Now that your code is on your computer, build the first feature for your website. Continue to Writing and storing your code.