Skip to content

git-gui Git Command Guide

The git gui command provides a portable graphical user interface to Git based on Tcl/Tk. It focuses on commit generation, branch creation, merging, and repository browsing, working across UNIX, macOS, and Windows platforms.

Terminal window
git gui [<command>] [<arguments>]
CommandDescription
(none)Start the main GUI interface
blame []Start blame viewer on file at specified revision
browser Browse tree at specified commit
citoolSingle-commit mode interface
versionDisplay git gui version
ArgumentDescription
File path for blame/browser operations
Commit or tree object to examine
Additional arguments for specific subcommands
Terminal window
git gui

Opens the standard git-gui interface for commit creation and repository management.

Single commit mode (git-gui for commit templates)

Section titled “Single commit mode (git-gui for commit templates)”
Terminal window
git gui citool

Starts simplified interface for making exactly one commit before exiting.

Terminal window
git gui blame Makefile

Shows blame annotations for Makefile in working directory, attributing changes to “Not Yet Committed” for unstages changes.

Terminal window
git gui blame v1.0 Makefile

Shows file content at v1.0 tag with blame annotations showing original authors.

Terminal window
git gui browser HEAD

Opens tree browser showing all files at HEAD commit for exploration.

Terminal window
echo "# new line" >> file.txt
git gui blame file.txt

Shows working directory file with unstaged changes marked as “Not Yet Committed”.

Terminal window
gitk --select-commit=<commit> && git gui blame <file>

Use gitk to find commit, then use git gui to see detailed file annotations.

While git gui is for creating commits, amending changes, and managing staging, gitk is strictly for browsing repository history and visualizing the commit graph without providing editing capabilities.

Can git gui edit individual lines or only manage whole files?

Section titled “Can git gui edit individual lines or only manage whole files?”

git gui stages complete files by default but can be configured to do line-by-line staging. Use the “Stage Lines” option when right-clicking in the diff view to stage individual changed lines.

What’s the difference between the main interface and citool?

Section titled “What’s the difference between the main interface and citool?”

citool is a simplified interface specifically for making commits in scripted scenarios. It removes history browsing and branch management features to focus purely on commit creation.

git gui provides conflict resolution tools including visual merge interface. When conflicts exist, git gui shows conflicted files and allows resolving conflicts through a visual interface before staging.

Can I use git gui without Tcl/Tk installed?

Section titled “Can I use git gui without Tcl/Tk installed?”

No, git gui requires Tcl/Tk runtime which must be separately installed. Without Tcl/Tk, git gui will fail to start. Consider installing Tcl/Tk from your system’s package manager.

git gui blame annotates each line with the author who last modified it, showing commit date and originator. It colors differently based on author and provides line-by-line history information.

git gui provides visual feedback for Git operations and can help beginners understand staging and commit workflows. However, learning command-line Git provides more comprehensive understanding.

git gui works with binary files for staging/unstaging but cannot show diffs for binary content. Use git command line for binary file operations and rely on git gui for other repository management.

git gui has limited submodule support. While it can show submodule status, most submodule operations should be performed using command-line git submodule commands.

git gui works on all platforms supported by Git: Linux, macOS, Windows, and others. It uses native UI guidelines per platform (GTK on Linux, native Windows API, etc.).

How do I configure git gui for my workflow?

Section titled “How do I configure git gui for my workflow?”

git gui can be configured through git config variables like gui.editor for the text editor, gui.diffcontext for diff viewing context, and gui.encoding for character encoding.

  1. Visual Commit Creation: GUI interface for staging files and writing commit messages
  2. Beginner-Friendly Git: Visual representation of staging area and commit preparation
  3. Merge Conflict Resolution: Visual tools for resolving merge conflicts interactively
  4. Code Review Integration: Blame viewer for understanding code authorship and history
  5. Rapid Prototyping: Quick commits and branch management during development sprints
  6. Cross-Platform Git: Portable interface across different operating systems