Clone a Repository
Prerequisites
- Create a repo or choose an existing Hakai repo
- Create a Personal Access Token (PAT) (You only need a PAT if cloning a repository via CLI for first time)
Get Repo URL
- Go to the github.com/hakaiinstitute/your-repository
- On the repository page, click on Code > HTTPS and then copy the URL
Clone Repo
- Copy the repository URL (see above)
- Open a terminal window by either
- RStudio: Tools > Terminal > New Terminal
- Git-Bash: Search for Git Bash and launch app
- In the terminal, navigate to some directory where you'd like to save this repository
ls -lto list available directoriescd ./path/to/directory/to-store-new-project- See using the Linux CLI for more info
- Run
git clone [the_github_url] - If prompted, enter your github username and the PAT you generated (first time you clone from github only)
- Change into the project directory:
cd [repository-name-here] - Run
git remote -vto verify that the remote github URL is listed
- Copy the repository URL (see above)
- Open Positron
- Click New > New Folder from Git...
- Paste in the repository URL
- Select where you'd like to save this repository
- Click OK
Positron should clone the remote repository into the folder you specified. If prompted, login to GitHub with OAuth to allow Positron to download the repo. To verify, open the Version Control icon in the left-hand vertical menu.
- Copy the repository URL (above)
- Open RStudio
- Click File > New Project
- Select Version Control
- Select Git
- Enter the repository URL
- Click Create Project
You may see a pop-up to authenticate the first time you clone from GitHub.
- Select the Device/Browser tab
- Click Sign in with your browser to use OAuth
- Complete login to github via your browser