Beginner lesson 2 of 6

Create a Git repository and your first commit

Initialize a local repository, configure its author identity, and record a first commit without a hosting account.

Before you start

You have a new project and want a reliable first checkpoint. This exercise uses local Git only: a GitHub account and a GitGlow account are unnecessary. Commit identity is metadata, not authentication.

Use Git 2.28 or newer in a POSIX shell on macOS/Linux, or Git Bash on Windows. Check git --version; Git's installation page covers setup. Each example starts in a new temporary folder. Keep that folder if you want to revisit your work; none of these commands removes your existing projects. The identity and signing settings below apply only to the practice repository.

Work through the example

practice=$(mktemp -d "${TMPDIR:-/tmp}/gitglow-learn.XXXXXX")
sandbox="$practice/project"
mkdir "$sandbox"
cd "$sandbox"
git init -b main
git config --local user.name "Git Learner"
git config --local user.email "learner@example.invalid"
git config --local commit.gpgsign false

Create and review a short project file. Using an explicit filename keeps unrelated files out of the snapshot:

printf '# My practice project\n\nA place to learn Git.\n' > README.md
git status --short
git add README.md
git diff --cached
git commit -m "Add project introduction"
git log -1 --oneline
git status --short

Check the result

History contains one commit named Add project introduction; the final short status is empty. The hash on your computer will differ from anyone else’s. git config --local stores the practice author in this repository instead of changing your global identity.

Try it yourself

Add a purpose sentence to README.md, review the diff, and make a second commit with a specific message. git log --oneline should show two checkpoints.

If something goes wrong

If Git is missing, install it first and reopen the shell. An “Author identity unknown” error means the repository-local name/email commands did not run in this folder. The example disables signing only in this sandbox so a global signing setup cannot block practice.

Use this workflow in GitGlow

Use Open repository to open this sandbox, or Initialize repository to begin your own new project. Review Changes, stage README.md, and use the commit composer. These desktop actions are Free. Git author identity remains your Git configuration.

Download GitGlow Free

Go deeper with the official Git docs

These references cover command options and behavior beyond this example.