Git is a VCS that allows you to work locally and save (commit) snapshot versions of a file (repository) so that you can reference or revert back to them.
Nope. GitHub is a website that hosts repositories (repos) remotely so that commits can be accessed by multiple people who can then work on and update them simultaneously without losing or writing over anyone's changes.
- You initialize tracking. git init
- You add to the staging area. git add
- You commit (aka save as a kind of freeze frame or snapshot) for the first time. git commit -m "Initial commit"
- You work on a file more until you're ready to set it up to be committed again. You add it to the staging area. git add
- You commit the updated file/changes. git commit -m "Clear, brief, present tense documentation of changes here"
- You keep working and updating and staging and committing different snapshot of the repo.
git init
git add
git commit -m "Initial commit"
git add
git commit -m "Add code example"
- You can set up your repo on GitHub so that it is housed there. This allows for more cool stuff to be possible.
- You can pull and
git push
commits between your local Git and the remote repo in GitHub. - You can create and work from branches that are extended from your original master repo. This keeps the original master intact while allowing you to branch off and make changes. You can add and remove branches as you need and no longer need them.
- Others can clone your work and dive into working on it as well without effecting your original master.
- Others can work simultaneously on parts of the repo by pulling the latest commits, making their own updates, and pushing their updated commit back to GitHub. Even if you are simulaneaously working on the same branch or section, one's work doesn't overwrite the other's; they can be merged so nothing is lost.