Say you are solving the Rubik’s cube, and you are a couple of steps toward the whole solution and at this point you get stuck. Maybe you would need to track back a few steps or get assistance from a friend to solve the cube’s puzzle. To do this, you would have to lose all your progress and start afresh, to try out different solutions.
Consequentially, if the new method fails and you needed to go back to the initial process, it would be quite difficult unless you can recall all the steps you had made. In working on work projects( The Rubik’s cube solution in our analogy), this is where git comes in and the friend you would ask for assistance, in this case, would be a colleague you are collaborating with on the project.
Git solves the challenge of losing previous work and the inability to keep track of changes made when trying to find a solution to a problem e.g. the Rubik’s cube in the analogy. This practice of tracking and managing changes is called version control. Git is a version control system, built to track and manage changes in software code.
To keep track of changes, git takes a snapshot of the project at a specific point in time. To command git to take a snapshot at a specific point in a project, a commit command is run. Git might need to store this snapshot at a location where a colleague at work can access it when you need their contribution to the project from them.
To solve this issue is where GitHub comes in. GitHub is a platform that provides hosting services for snapshots taken through git commits.
Through GitHub, one can access projects that have been kept record of by git, and hosted on GitHub. By accessing the projects from time to time, developers can keep track of changes that had been made whenever a commit was run. Through GitHub, colleagues can also add their input contributions to the code and host them on GitHub also. Awesome, right?
We have mentioned running a commit command in git to take snapshots of a project. Actions in git are operated by running commands. Commands for git are run in a command-line interface called Git Bash. There are some terminologies and common commands used in git, outlined here