The primary purpose of Git is to keep a history of changes, or revisions. To illustrate this, let's create a simple file and commit it to the history of the repository.
Learning the basics
Committing to history
First, let's confirm our repository's Git history by running git log, which shows a history of past commits:
$ git log
fatal: your current branch 'master' does not have any commits yet
The error correctly informs us that there are currently no commits. Now, let's create a short README.md file, which represents the first change we want to commit:
$ cd ~/projects/hobnob/
$ echo -e "# hobnob" >> README.md
We've created our first file and thus made our first change....