Two tools with different jobs
Git and GitHub often appear together, but they are not the same thing.
| Tool | Simple meaning | Where it works |
|---|---|---|
| Git | Records and compares project versions | On your computer |
| GitHub | Stores Git repositories online and supports teamwork | On the Internet |
You can use Git without GitHub. Your local history still works when you are offline.
You need a service such as GitHub when you want to publish the repository, keep a remote copy or collaborate through Pull Requests.
Follow the two locations
YOUR COMPUTER GITHUB
project files remote repository
local Git history -- push --> shared Git history
<-- pull --
Saving a file does not create a Git version. Creating a Git commit does not automatically publish it on GitHub. Each action has a different result.
Where the work exists
Yassine changes index.html and saves the file.
- The change exists in his project folder.
- It is not yet a Git commit.
- It is not yet on GitHub.
He creates a commit.
- The version exists in his local Git history.
- It is still not on GitHub until he pushes it.
The distinction in one example
Git lets Yassine record the change on his computer. GitHub lets his team see the repository online. The commit becomes part of the remote repository only after a successful push.
What to remember
Git manages versions. GitHub hosts and shares Git repositories. Commit is local; push publishes commits to a remote repository.