Before you start
Two branches edit the same greeting. Git cannot choose which wording you intended, so you must review both inputs and write the result. This lesson covers a normal text merge; rebase input labels and binary conflicts need their own context.
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 'Welcome\n' > greeting.txt
git add greeting.txt
git commit -m "Start greeting"
git switch -c feature/friendly
printf 'Hello, friend\n' > greeting.txt
git add greeting.txt
git commit -m "Make greeting friendly"
git switch main
printf 'Welcome to the project\n' > greeting.txt
git add greeting.txt
git commit -m "Make greeting specific"
The next command is expected to stop with a nonzero exit status and a conflict. Continue with inspection after reading its output:
git merge feature/friendly
git status --short
cat greeting.txt
git show :2:greeting.txt
git show :3:greeting.txt
For this merge, stage 2 is main (current) and stage 3 is the feature branch (incoming). Write a combined greeting, review it, then finish:
printf 'Hello, friend. Welcome to the project.\n' > greeting.txt
git add greeting.txt
git diff --cached
git diff --cached --check
git commit -m "Merge friendly and specific greeting"
git status --short
git log --graph --oneline --all
Check the result
The final file contains your combined sentence without conflict markers, status is clean, and the merge commit has two parents. Staging marks your resolution as ready; it does not establish that the text or program behavior is correct.
Try it yourself
Before resolving a fresh conflict, try git merge --abort to cancel the merge, then start it again. Review and preserve any pre-existing local work before beginning a real merge.
If something goes wrong
If a conflict marker remains, reread the file and check the staged diff. --check catches marker/whitespace problems but does not replace tests. If Git refuses the final commit, git status lists unresolved paths. Do not use “ours” or “theirs” blindly across operation types.
Use this workflow in GitGlow
Open Changes during the conflicted merge. Read the labelled Current and Incoming inputs, edit Result or use the supported side choices, then Save resolution. Resolve all files and choose Continue operation. Conflict resolution and supported Continue/Abort actions are Free.
Go deeper with the official Git docs
These references cover command options and behavior beyond this example.