Git is the tool that we can use to save all changes and additions to our code on the computer we’re working on. GitHub is the online location we can upload our Git-managed code to for safekeeping.
Follow along to learn what Git and GitHub are.
Git is a free and open source distributed version control system that allows us take a snapshot of our program, called a commit, at important points along the way as we code.
You can think of a commit like a save point on a document that you are writing. Although unlike a save, once a commit is made, it is permanently stored in the history of the project. A newer commit does not overwrite the previous commit. If we ever want to go back to the place in time where the commit was made, where all the files looked exactly as they did when we committed, we will be able to do so.
Additionally, commits are made with brief messages that describe the changes/additions being saved. For instance, if we were creating a basic website, and added a about page with a picture of ourselves and a description about us, when we saved those changes by committing we would include a message like “Add about page with pictures and descriptions.” Commit messages are written in present tense (ie: “Add about page…” not “Added about page…”).
When we are ready to save the code from our computers to a location on the web, we can use GitHub. GitHub allows us to create repositories to store the code and code history for each of our projects. A repository is what we call the container that holds all of the files from our project with all of the commits that have been made to it. GitHub is designed to work seamlessly with Git.
Some Coders use LinkedIn as an employment resume and GitHub as a coding resume.
Do note that all repositories on GitHub are public by default. For a monthly fee, GitHub does offer unlimited private repositories. However, this is entirely optional. It’s standard practice for most developers to simply leave everything public, even if projects are still a work in progress.
Remember that Git is the tool that we can use to save all changes and additions to our code on the computer we’re working on. GitHub is the online location we can upload our Git-managed code to for safekeeping.