Welcome to the repository for shared notes, challenge solutions, resources and other bits and bobs from Coder Academy's Melbourne bootcamp cohort.
Coding is hard, pushing to GitHub even scarier. The repo is a space to practice and share your stuff with fellow students.
Any and all contributions are welcome - consider this our very first open source project!
Please DM me if you'd like to be added to the repo as a contributor.
You'll receive an invite from GitHub which you'll need to accept first to have the correct permissions.
All contributors will have full read/write access so you can push updates straight away.
As all contributors automatically have read/write access, please check that you have the latest version of the repository cloned locally to your laptop before pushing changes so existing updates aren't overridden! 🤗
Before you set up your fork and remote, decide where you want this to be saved on your local computer.
Create this folder somewhere meaningful so that once you have setup the remote, you can push updates automatically using the Updating Your Forked Repository and Pushing Updates to GitHub instructions.
Note: When you clone a repository to your computer, GitHub will create a folder for the repo and copy the cloned files into this folder. Avoid renaming or moving this folder otherwise you will need to set up the remote again.
While logged into your GitHub account, navigate to the ca-study-group repository and hit the Fork button in the top-right hand corner:
https://github.com/linda-lai/ca-study-group
That's it! There's now a forked version saved to your GitHub.
While forked version is saved in your GitHub account online, you won't have the files in the repository on your computer.
To create a clone of your fork locally on your computer:
-
Navigate to the forked ca-study-group repository saved to your GitHub.
-
Under the repository name, click Clone or download.
-
In the Clone with SSH section, click the clipboard to copy the clone URL for the repository:
-
Open Terminal.
-
Type
git clone
, and then paste the URL you copied:$ git clone git@github.com:YOUR_USERNAME/ca-study-group.git
-
Press Enter. A local clone will now be created on your computer.
To setup the connection to allow GitHub to pull updates from the original upstream repo (https://github.com/linda-lai/ca-study-group), to your forked version, i.e. origin:
-
Navigate to original ca-study-group repository on GitHub.
-
Under the repository name, click Clone or download.
-
In the Clone with SSH section, click the clipboard to copy the clone URL for the repository.
-
Open Terminal and change directories into the folder where you have cloned the local files to.
-
Type
git remote -v
and press Enter to see the current configured remote repository:origin git@github.com:YOUR_USERNAME/ca-study-group.git (fetch) origin git@github.com:YOUR_USERNAME/ca-study-group.git (push)
-
Type in
git remote add upstream
and paste in the URL copied from the original (not forked) repository and hit enter. It should look like:$ git remote add upstream git@github.com:linda-lai/ca-study-group.git
-
To confirm the new upstream repository has been correctly set up for your fork, type
git remote -v
again. It should show the URL for your fork as the origin and the original repository as the upstream.origin git@github.com:YOUR_USERNAME/ca-study-group.git (fetch) origin git@github.com:YOUR_USERNAME/ca-study-group.git (push) upstream git@github.com:linda-lai/ca-study-group.git (fetch) upstream git@github.com:linda-lai/ca-study-group.git (push)
To download the latest files from the original repo:
- Check your forked repository to confirm if there have been additional updates made. If there have been updates, GitHub will show the below message: "This branch is [X] commits behind linda-lai:master."
Note: Make sure you are on your master branch before pulling from the upstream (original) repository.
-
To check your current branch:
$ git branch
-
Checkout so that you are on your master branch (if you aren't already):
$ git checkout master
-
While on your master branch, to download the latest files to your local computer, enter:
$ git pull upstream master
This will download the latest version of the files to your computer.
-
To push the latest files from the original GitHub repo to your forked repo, enter:
$ git push origin master
Once you've updated your forked repo and downloaded the latest files to your local computer:
-
Create a new branch or checkout to an existing branch to work from.
To create a new branch:
$ git checkout -b [BRANCH-NAME]
To go back to an existing branch to work off:
$ git checkout [BRANCH-NAME]
-
Make your updates to the existing file and/or save the files you'd like to push to original repo into the relevant folder.
-
When you are ready to commit and push the updates, open up Terminal and check the changes and branch to be committed:
To check your current branch:
$ git branch
To check which files have been changed:
$ git status
-
Add the file(s) to be pushed through as an update:
$ git add [FILENAME-1] [FILENAME-2]
-
Commit the changes:
$ git commit -m "[COMMENTS RELATED TO UPDATE]"
-
Push the update to the main repo:
$ git push origin [BRANCH-NAME]
-
Voila! The changes will be pushed to the main repo.
To download the updated repo files to your local computer and push to your GitHub account, follow the steps outlined in the Updating Your Forked Repository section.
To keep things manageable and findable (and to be nice to your fellow contributors), please label for file or leave comments with your name so we know who's contributed the file without having to dig through the logs.
For example:
js-fundamentals-q1-linda.js
That way, if you find a solution or notes that you'd like to rubberduck with the owner, you can easily find out who.
Any questions, shout out!