GitHub Basics
GitHub Basics
1. Clone a Repository
Scenario: You think of an idea, you google it, you found that someone made an open source code on it, and you want to try it.
git clone REPOSITORY
You don’t have to have a GitHub account for this. All you need is to have git installed (comes with Unix-based computers, need to be installed for Windows)
Or, if you have an account, you can fork it (and that copies it to your GitHub account).
2. Push
Scenario: You downloaded the repository, made some changes on your computer, and you want to “push” these changes to your account on GitHub.
git add --all # adds your changes
git commit -m "message" # commits to them and adds a message
git push -u origin master # pushes the changes to the repository
3. Pull
Scenario: You have a repository on your computer and you want to update it with changes you made on your GitHub account from another computer
git pull REPOSITORY
It’s a little more complicated than that, see this GitHub guide for more details.