Clone a repository from GitHub to work on the files locally. After you clone a repository (repo), all of the files will be downloaded into the local directory you specify.
You can clone your own repo to work across multiple devices (e.g., work desktop and laptop). If you clone someone else's repo, you'll need the right permissions or you won't be able to [[commit]] changes.
Before cloning a repo, you must first install and configure the [[Github CLI]].
## instructions
1. Navigate to the repository on [Github.com](https://github.com/) (login if required).
2. Click the green **Code** button.
3. Copy the link shown under the SSH tab (if you have not [[set up SSH in GitHub]], which is recommended, you may copy the link under the HTTPS tab).
4. Open your file explorer and navigate to the parent folder in which you want to clone the repository. For me, this is almost always my `_dev/` directory.
5. Right-click within the folder to open the context menu and select **Git Bash Here** (if you don't have this option, re-run the Git for Windows installer using [[Git for Windows installation | these instructions]]).
6. In the terminal, use the command `git clone` and paste the `<url>` (`Ctrl + Shift + V`) (if you cannot paste into the Terminal, review [[configure Git Bash]] for help).
```bash
git clone <url>
```
7. You should now see the repository was created as a directory in the parent folder. You can confirm by switching into the directory and checking for a successful remote connection.
```bash
cd <repo-directory>
git remote -v
```
## Options
- The default behavior is to create a local directory with the same name as the repository. To change the directory name, type the desired name after pasting the url:
```bash
git clone <url> <dir-name>
```