- Fork this repository on GitHub.
- Open VSCode, open a terminal, and clone your fork: git clone
- Change into the repository directory: cd git-assignment-2
- Open the
git-assignment-2folder in VSCode. - Open the
README.mdfile (this file). You will edit it in VSCode. - Industry vocabulary
- origin = your fork (
your_username/git-assignment-2) - upstream = my repository (
josephor1271/git-assignment-2)
-
Create a new branch named
writing: git checkout -b writing -
Check which branch you are on:
git status
It should say you are on branchwriting. -
Push this branch to GitHub:
git push -u origin writing -
Make a change to the line below in this file:
Round Rock Highschool + Electrical Engineering -
Add, commit, and push your changes:
git add README.md
git commit -m "Add school and intended major"
git push -
On GitHub, open a pull request within your fork:
- From:
writing - To:
main - Make sure you are not pull requesting upstream (my repository).
My username should not appear anywhere in the pull request. - It should look like:
main <- writing
-
Merge the pull request on GitHub.
(If GitHub does not let you merge, you likely pull requested upstream by mistake.) -
After merging, your
mainbranch and yourwritingbranch on GitHub should look identical. -
You have now successfully used a branch and merged it into
main.
-
GitHub now has your merged changes, but your local repository does not yet.
Switch tomainlocally:
git checkout main -
Make sure you are on
main:
git status -
Pull the latest changes from GitHub:
git pull -
Add a new line below:
Ronaldo is better than Messi -
Add, commit, and push your changes:
- git add README.md
- git commit -m "Add controversial opinion"
- git push
-
Confirm that your controversial statement appears on the
mainbranch of your fork on GitHub. -
On GitHub, go to Pull Requests and open a new pull request:
- From:
your_username/git-assignment-2main - To:
josephor1271/git-assignment-2main - It should look like:
josephor1271/git-assignment-2 main <- your_username/git-assignment-2 main
-
Submit the pull request.
-
After the due date, I will accept one of the submitted pull requests.
Submit a link to your fork of this repository on Google Classroom.
This part is optional, but recommended if you finish early.
-
Make sure you are on the
mainbranch:
git status
If not:
git checkout main -
Create a new branch called
typo-fix:
git checkout -b typo-fix -
Find any typo or wording you think could be improved in this README and fix it.
-
Add, commit, and push your changes: \ git add README.md OR git add .
git commit -m "Fix typo in README"
git push -u origin typo-fix -
On GitHub, open a pull request from
typo-fixtomainwithin your fork.
Do not include my repository in this pull request. -
Merge the pull request.
-
After merging, your
mainbranch and yourtypo-fixbranch should be identical.
If you complete this, you have now practiced the full GitHub workflow twice:
branch → commit → push → pull request → merge.