>_ IzzyLab

Hands-on task

This task is step 1 of the course “Everyday Git”

First git commit

easy~5 min

The directory /root/project contains files for a future repository. Initialize a git repository and make the first commit, adding all files to it. Configure the author beforehand (git complains without user.name/email).

What you'll practise:
  • git
  • repository initialization
  • git config
  • staging area
  • first commit

Topic breakdown

Git is a version control system: an ordinary directory becomes a repository when a service .git folder with a history of snapshots appears inside it. A commit works in two steps through an intermediate area (staging/index): first changes are marked for saving, then they are recorded as an immutable snapshot with a message — this two-stage nature lets you choose what exactly goes into the commit. Before the first commit git requires knowing the author's identity (user.name and user.email), which is set via git config globally or only for a specific repository.

What's checked

  1. /root/project is a git repository
  2. exactly one commit in the repository
  3. all files made it into the commit

What it looks like