Share
Explore

For section 1 entry point - Here is how to make a LOCAL from the github repo in the file attached, using PAT method

Section 1: Entry Point for Creating a Local Repository from GitHub

Goal: Clone the repository from GitHub to your local machine using the HTTPS method with your Personal Access Token (PAT).
Sample of what your GitHUB REPO might look like:
image.png

Checklist Instructions:

Copy the Repository URL:
Go to the repository page on GitHub.
Click the green Code button.
Ensure HTTPS is selected.
Copy the repository URL (e.g., https://github.com/ProfessorBrownBear/PeterREPODec02_1209).
Open a Terminal/Command Prompt:
Navigate to the folder where you want to clone the repository:
image.png
cd /path/to/your/desired/folder
Clone the Repository Using Git:
Run the following command, replacing <repository-URL> with the copied URL
Authenticate with PAT:
image.png
When prompted for your username, enter your GitHub username. i.e. ProfessorBrownBear
When prompted for your password, paste your Personal Access Token (PAT). (If you do not already have a PAT, follow GitHub’s documentation to generate one.)
Clone the repository using the gh command:
gh repo clone ProfessorBrownBear/PeterREPODec02_1209
image.png

Verify the Repository Was Cloned Successfully:
Change into the cloned repository folder:
List the contents to confirm files were downloaded:
Expected output:
.gitignore
README.md
image.png

Result (Exit Point): The repository has been successfully cloned to your local machine, and you are ready to start working on it.

Teaching points about GitHUB CLI (gh)

When using the new GitHub CLI (gh), you do not prefix the traditional git commands like git clone with gh. Instead, gh commands are specific to the GitHub CLI and provide additional features that integrate directly with GitHub, such as repository creation, authentication, and management.
Here’s how the process works:

Using GitHub CLI for Repository Cloning

If you want to use the GitHub CLI to clone a repository, you can run:
gh repo clone ProfessorBrownBear/PeterREPODec02_1209
This replaces the traditional git clone command and simplifies the process.

Comparison of Commands

Traditional Git Command:
git clone https://github.com/ProfessorBrownBear/PeterREPODec02_1209
Requires manual handling of HTTPS credentials or PAT (Personal Access Token) if needed.
GitHub CLI Command:
gh repo clone ProfessorBrownBear/PeterREPODec02_1209
Automatically handles authentication (if you are logged in via gh auth login).
No need to provide HTTPS credentials explicitly.

Which Should You Use?

Use gh commands (like gh repo clone) if you have authenticated via the GitHub CLI (gh auth login).
Use git commands (like git clone) if you prefer traditional Git workflows or are not using the GitHub CLI.

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.