A summary of commands to work with GitHub.
-
On github.com, go to the repo which you'd like to clone
-
Fork the repo by clicking on the 'Fork' button on the top right corner of the page
-
In your terminal,
cd
to a folder where you want to keep this repo (e.g. Desktop/coding/week-1), and rungit clone http://www.github.com/YOUR_GITHUB_USERNAME/js-functions
-
You'll now have the repo running on your local machine! Awesome! After making changes to the files, run the following commands to commit and push your changes to github:
git add -A git commit -m "your awesome commit message" git push -u origin master
-
Your code is now on your repo on github!
-
On github.com, create a new repo by clicking on the
+
button on the top right corner of the page. -
[Skip this step if you've already created your folder, html file(s) and js file(s)] If you haven't, you can create your folder and files for your program:
mkdir my-awesome-repo cd my-awesome-repo touch index.html style.css script.js
-
In the terminal,
cd
to the folder which you want to push to github, and run:git init git remote add origin YOUR_GITHUB_REPO_URL
-
Your local repo is now linked to your github repo. To push your code to github, run the message commands as before:
git add -A git commit -m "your awesome commit message" git push -u origin master
-
Done! Remember to run step 4 (add, commit, push) regularly!