A tiny shopping list for practising Git and GitHub: forking, cloning, pushing, and pulling.
-
Click Fork at the top of this page to make your own copy.
-
Clone your fork (use the HTTPS URL instead if you don't have an SSH key set up):
git clone git@github.com:<your-username>/github-demo.git cd github-demo
-
Make a branch:
git checkout -b add-<your-username>
-
Open
shopping-list.mdand add one item to the end of the list. -
Commit and push to your fork:
git add shopping-list.md git commit -m "Add <item> to shopping list" git push -u origin add-<your-username>
-
On GitHub, click Compare & pull request to send your change to the original repo.
-
Connect to the original repo (only needed once):
git remote add upstream git@github.com:churslic/github-demo.git
-
After the pull requests are merged, get the latest list:
git checkout main git pull upstream main
-
Update your fork on GitHub:
git push origin main