Skip to content

Workflows git

Eugene Lazutkin edited this page Apr 10, 2026 · 6 revisions

Workflows: git

See git configuration for aliases, pretty formats, and diff-so-fancy setup.

Interactive git

For rarely used commands and anything requiring a code review, interactive tools work best.

GUI users can rely on git-gui and gitk, both bundled with git. For terminal-only environments, lazygit is a solid TUI alternative. All three are installed by this project by default.

Alias Tool Type Usage
gg git-gui GUI Review files before commit, create a commit, create a branch.
gk gitk --all GUI Project commit history, branches, tags. Individual file/folder commit history.
lzg lazygit TUI Similar to git-gui but in a terminal.
gls git ls CLI List commits with tags and branches. CLI counterpart to gk.

Working on features

Day-to-day feature-branch work uses a small set of aliases. Each wraps a git command with colored output and tab-completable branch names.

Alias Description
gcob git checkout -b — create a new branch from the current one.
gpush git push
gpull git pull
gsw [branch] git switch — switch to a different branch. Defaults to the main branch (main or master) when called without arguments.
gme [branch] git merge — merge from a different branch. Defaults to the main branch, same as gsw.
gst git status — see what files were created or modified.

Typical feature-branch lifecycle:

# create a feature branch and switch to it
gcob feature-branch
# work on code, review changes with gg or lzg, commit
gpush
# switch back to the main branch and update it
gsw
gpull
# switch back to the feature branch (name is tab-completable)
gsw feature-branch
# merge the latest main into the feature branch
gme
gpush
# when the feature is ready, merge it back to main
gsw
gme feature-branch
gpush
# optionally tag the release
git tag 1.2.3
gpush --tags

Working with submodules

Many projects in this setup include associated GitHub wikis or other repositories as submodules. Two helpers keep them in sync:

Alias Description
gpurr Pull the current repo and all its submodules, then check out and pull the main branch in each submodule.
gpwiki Same as gpurr, but limited to submodules in directories called wiki or external_wiki.

Clone this wiki locally