Branches & Merging
Learn how to work with branches and merge changes in GitGUI.
The Sidebar
The left sidebar shows your repository's branch structure:
- Local — Branches on your machine
- Remote — Branches on remote servers (origin, etc.)
- Stashes — Saved work-in-progress
Viewing Branches
Branch Tree
Branches are displayed in a tree structure. Folders group related branches:
Local
├── main
├── develop
└── feature/
├── login
└── dashboardCurrent Branch
The current branch (HEAD) is highlighted with a special badge and accent color.
Branch Counts
Each section shows the total number of branches.
Switching Branches
Double-Click to Checkout
Double-click any local branch to switch to it (checkout).
Single-Click to Highlight
Single-click a branch to scroll the commit graph to that branch's latest commit without switching.
Creating Branches
From Context Menu
- Right-click any branch
- Select Branch from...
- Enter the new branch name
- GitGUI creates and switches to the new branch
Branch Naming Tips
- Use prefixes:
feature/,fix/,hotfix/ - Keep names descriptive but concise
- Avoid spaces (use hyphens or underscores)
Merging Branches
Drag & Drop Merge
The fastest way to merge:
- Drag the source branch (the one with changes)
- Drop it onto the target branch (where you want the changes)
- GitGUI will:
- Switch to the target branch if needed
- Perform the merge
- Show success or conflict notification
Context Menu Merge
- Right-click the branch you want to merge FROM
- Select Merge into...
- Choose the target branch
- Confirm the merge
Merge Results
| Result | What Happens |
|---|---|
| Success | Changes merged, commit graph updates |
| Fast-forward | Branch pointer moves, no merge commit |
| Conflicts | Files with conflicts shown in staging panel |
Handling Merge Conflicts
When a merge has conflicts:
- GitGUI shows a warning notification
- Conflicted files appear in the staging panel
- Open each file in your editor to resolve conflicts
- Stage the resolved files
- Commit to complete the merge
Conflict Markers
Look for these markers in conflicted files:
<<<<<<< HEAD
Your changes
=======
Their changes
>>>>>>> branch-nameDeleting Branches
Delete Local Branch
- Right-click the branch
- Select Delete branch
- Confirm deletion
- Optionally delete from remote too
Cannot Delete Current Branch
You cannot delete the branch you're currently on. Switch to another branch first.
Delete Remote Branch
- Right-click a remote branch
- Select Delete remote branch
- Confirm deletion
- Optionally delete the local tracking branch
Pushing and Pulling
Push to Remote
Press Ctrl+P or use the header button to push your current branch to the remote.
Pull from Remote
Press Ctrl+Shift+P to pull changes from the remote into your current branch.
Behind/Ahead Indicators
The status bar shows if your branch is behind or ahead of the remote.
Working with Remotes
Remote Branches
Remote branches appear under the Remote section in the sidebar, organized by remote name (usually origin).
Tracking
When you checkout a remote branch, GitGUI creates a local tracking branch automatically.
Best Practices
Keep main/master Clean
- Don't commit directly to main
- Use feature branches for new work
- Merge via pull requests when possible
Merge Often
- Regularly merge main into your feature branch
- Smaller, frequent merges are easier than big ones
Delete Merged Branches
- Clean up branches after merging
- Keeps the sidebar tidy
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl+P | Push to remote |
Ctrl+Shift+P | Pull from remote |
Next Steps
- Viewing Diffs — Understand file changes
- Stashing Changes — Save work temporarily
