GIT FIELD GUIDE // 01

Create a clean first Git snapshot

Set repository identity, inspect the working tree, stage deliberately, and verify exactly what the first commit contains.

Scenario

You have joined a new project and need to create clean, reviewable snapshots.

BEFORE YOU START

Prerequisites and boundaries

  • Use a disposable repository or a new branch while practicing.
  • Know which files may contain secrets, generated output, or machine-specific settings.
  • Confirm that the intended author name and email are appropriate for this repository.

OPERATIONAL REASONING

Why this sequence matters

The goal is not merely to memorize commands. Each inspection, change, and verification step reduces a different failure mode.

01

Inspect before staging

A status check separates untracked, modified, and staged files before the first irreversible snapshot is created.

02

Stage an intentional set

Review the index instead of treating every file in the directory as equally safe to commit.

03

Verify the resulting object

The log and commit view confirm the author, message, and exact patch that other collaborators will receive.

STANDARD PROCEDURE

Create the first reviewable snapshot in a new repository.

Initialize first, inspect the working tree, stage the intended files, commit them, then verify the resulting history.

  1. 01
  2. 02
  3. 03
  4. 04
    git commit -m "Initial commit"Git commit documentation
  5. 05
    git log --onelineGit log documentation

INCIDENT RESPONSE

Prepare an existing project for a clean first commit without skipping identity and status checks.

Confirm the author identity and working tree before committing, then inspect the exact snapshot that was created.

  1. 01
    git config --get user.nameGit config documentation
  2. 02
  3. 03
  4. 04
    git commit -m "Baseline project"Git commit documentation
  5. 05
    git show --stat HEADGit show documentation

COMMON FAILURE MODES

What usually goes wrong

  • A secret or generated file was staged because the ignore rules were not reviewed.
  • The commit used the wrong identity because global and repository-local configuration were confused.
  • A successful commit was assumed to be correct without inspecting its patch.

VERIFICATION

Evidence to collect

  • git status reports the expected clean or intentionally modified state.
  • git show --stat HEAD lists only the files intended for the snapshot.
  • git log -1 displays the expected author and commit message.