Introduce version control basics using Git and GitHub. By the end of this lab, you should:
- Setup Git with your personal details.
- Create and use a personal access token on GitHub.
- Know how to create, clone, commit to, and push from a repository.
Before using Git, you should configure your name and email address as they'll be associated with your commits.
Open your terminal and execute the following lines one line at a time. Replace "Your Name" with your actual name and "[email protected]" with the email address that you used when signing up for GitHub.
git config --global user.name "Your Name"
git config --global user.email "[email protected]"- Log in to your GitHub account.
- Click on your profile picture in the top right and select
Settings. - In the left sidebar, click on
Developer settings. - Click on
Personal access tokensin the left sidebar. - Click the
Generate new tokenbutton. - Give your token a descriptive name.
- Under scopes, select the checkbox
repoto grant access to your repositories. - Click the
Generate tokenbutton at the bottom. - Important: Copy the generated token and store it somewhere safe. You won't be able to see it again!
When you clone or push to a repository for the first time, you'll be prompted for a username and password.
- For the username: Enter your GitHub username.
- For the password: Use the personal access token you just created, not your GitHub password.
Follow the listed instructions to create a repository called first-github-repo in your GitHub profile.
Follow the the listed instructions to clone the first-github-repo repository to your local machine.
Using your file navigator, copy the files from this folder (vscode-setup) into your first-github-repo repository.
Follow the instructions starting at "Check local changes" to add, commit, and push the first-github-repo files and folders to your GitHub repository.
Complete this lab by completing the module labeled exercise.py in your newly pushed repository. As you complete each comment, get into the habit of committing and pushing your code!
This exercise will not be submitted for grading.