Skip to main content
In this lesson you’ll initialize a Git repository inside the Blockbuster project folder to start tracking changes, enable easy rollbacks, and keep a clear project history. What you’ll learn:
  • Verify Git is installed.
  • Initialize a repository and inspect its status.
  • Stage and commit files.
  • Restore deleted files from history.
  • Configure author identity for commits.
Prerequisites
  • Git installed on your machine. Many Ubuntu distributions include Git by default.
  • If you’re unsure, verify with:
If Git is missing or you want to upgrade, visit https://git-scm.com for installers or use your platform package manager. Common install commands:
Initialize a repository
  1. Change into your project directory (for example, the Blockbuster folder).
  2. Before initialization you should not see a .git directory:
  1. Initialize the repository:
  1. Confirm the .git directory exists:
Check repository status After initialization, check the repo status to see which files are untracked:
Stage files for commit You can stage individual files or stage all current files. To stage everything in the directory:
Commit staged files Create the initial commit with a descriptive message:
Verify a clean working tree:
Restore deleted files from history Git can restore files removed from the working tree if they existed in the last commit.
Make a small change and commit Edit README.md (for example, fix a typo), then stage and commit the change:
Inspect commit history View the commit log to see past commits, authorship, and timestamps:
Configure author identity Git records the author for every commit using user.name and user.email. You can set these globally (applies to all repositories for your user) or locally (only for the current repository). Set a global identity:
Or set them only for the current repository:
After updating the config, make another commit and verify the author fields:
If you are working on a shared machine or with multiple identities, prefer using git config --local (inside the repo) to avoid changing your global settings. You can always override per-repository with the local config.
Quick reference — common Git commands Links and references This completes the basic Git initialization workflow: verify/install Git, initialize the repository, stage and commit files, restore files from history, and configure author identity.

Watch Video