- Understand the basic Git workflow: fork, clone, commit, push, and create a pull request (PR).
- Write a personal introduction using a text file.
- Practice submitting work using GitHub.
-
Fork the Repository:
- You are already in the GitHub repository you want to fork.
- Click the Fork button in the upper right corner of the page.
- Remember, this creates a copy of the repository under your own GitHub account.
- Confirm that the repository now appears in your account, showing your username in the repository name (e.g.,
username/repository-name
).
-
Clone the Forked Repository:
- Navigate to your forked repository on GitHub (you should be already there but make sure you are not still in the original repository you should've forked already)
- Click the Code button and copy the HTTPS or SSH URL.
- Open your terminal or command prompt and navigate to the directory where you want to store the repository (for now you can even do it on your Desktop).
- Run the following command to clone the repository:
git clone <repository-url> cd repository-name # cd lab-git-practice-web-dev
-
Work on the Lab: Edit the Text File:
- Open the repository in your code editor (e.g., VS Code).
- Locate the
about-me.txt
file. - Fill in the details:
Please introduce yourself! - Your name: Jane Doe - Why you are interested in Web Development: I want to build amazing websites and web apps! - One fun fact about yourself or a goal for this course: I love painting landscapes.
- Save the file.
-
Commit Your Changes:
- Stage your changes:
git add about-me.txt
- Commit the changes with a meaningful message:
git commit -m "Added my personal introduction to about-me.txt"
- Stage your changes:
-
Push Your Changes:
- Push your changes directly to your forked repository:
git push
- Push your changes directly to your forked repository:
-
Create a Pull Request:
- Navigate to your forked repository on GitHub.
- Click Compare & pull request.
- Ensure the base repository is the original repository and the base branch is
main
. - Add a title and description for your PR:
- Example Title:
Lab X Solution Submission
- Example Description: "This pull request includes short summary about myself."
- Example Title:
- Click Create Pull Request.
- Share link to your Pull Request in the submission field on Student Portal.
Students will repeat the above steps for each new lab:
- Fork the original repository (if not already done).
- Clone the repository (only needed the first time).
- Work on the lab, commit the changes, and push to their fork.
- Submit a pull request to the original repository.
- Paste the URL to your Pull Request in the submission field on Student Portal.