Use a POSIX-style shell, such as Linux or macOS Terminal, or Git Bash on Windows. git --version checks whether Git is available; if it is not, follow the official installation instructions. These examples use git init -b, supported by Git 2.28 and later. git status -h shows short command help; git help status opens the full manual if installed, and q normally exits its pager.
Choose an existing writable directory for temporary work and set TMPDIR in this shell. On a system without a suitable temporary directory, export TMPDIR="$HOME" uses your home directory; the new folder will remain there until you remove it. Do not use a valuable project. Run this block as a unit:
sandbox=$(mktemp -d "${TMPDIR:?Set TMPDIR to a writable directory}/garden-git.XXXXXX")
if [ -n "$sandbox" ] && cd "$sandbox"; then
printf 'Example repository: %s\n' "$sandbox"
git init -b main &&
git config --local user.name "Garden Example" &&
git config --local user.email "garden@example.invalid" &&
git config --local --get user.name &&
git config --local --get user.email
else
printf 'Setup failed; stop and check TMPDIR.\n' >&2
fi
mktemp -d creates a new directory; cd enters it. If setup or a Git command fails, stop and correct it before continuing. The remaining examples assume this same terminal is inside that repository. The hidden .git directory contains repository data in this ordinary setup; use Git commands rather than editing it directly. Temporary storage may be cleaned automatically, so do not keep valuable work here.
git starts the program; init, config, and status are subcommands. An option such as --local changes how a command runs; quotes keep a value with spaces together. The new main branch is a name for a line of history; it points to no commit yet.
The local user.name and user.email settings supply commit identity, not authentication credentials. They can become visible when history is shared. Local settings apply here; global settings normally apply to the user, and system settings more broadly. For ordinary single-valued settings, the more specific value usually wins, although environment variables and command options can affect identity. git config --show-origin --get user.name helps locate the effective configured value; it does not reveal all possible identity overrides. Nothing above changes global settings.
Next: Select and record a version.