Before you start
A branch is a movable name pointing to a commit. Create a feature checkpoint without moving main, then merge the finished feature. This exercise has a clean merge; the conflict guide handles competing edits.
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
printf 'A small project\n' > notes.txt
git add notes.txt
git commit -m "Start notes"
git switch -c feature/describe-project
printf 'Purpose: practice small changes\n' >> notes.txt
git add notes.txt
git commit -m "Describe project purpose"
git switch main
cat notes.txt
git merge --no-ff feature/describe-project -m "Merge project description"
git log --graph --oneline --all
git status --short
Check the result
Before merging, main contains only the original line. After merging, notes.txt includes the purpose line, main points to a merge commit, and status is clean. --no-ff makes the merge relationship visible; without it Git may simply move main forward when a fast-forward is possible. Both histories retain the original commit.
Try it yourself
Create another feature branch, add one sentence, commit it, and merge it back into main. Compare the graph before and after the merge.
If something goes wrong
If switching is blocked by pending edits, inspect and commit or stash them before continuing; do not discard them to force the switch. If a branch name already exists, pick another name. A merge conflict requires resolving paths before committing.
Use this workflow in GitGlow
Use the repository navigator for branch creation and checkout; inspect History before choosing Merge. Everyday branches and merges are Free. Review the preview and active checkout before confirming. If a conflict occurs, resolution and supported Continue/Abort actions remain available on Free.
Go deeper with the official Git docs
These references cover command options and behavior beyond this example.