Skip to content

Workflows git

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

Workflows: git

See git configuration.

Interactive git

For all rarely used commands and commands requiring a code review I prefer interactive tools.

If you can use GUI, the obvious choice are tools bundled with git: git-gui and gitk. Otherwise, lazygit is a good TUI alternative. All these tools and installed by this project by default.

The tools I use on a regular basis:

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 with a TUI interface.
gls git ls CLI List commits with tags and branches. Similar to gk but CLI-based.

Working on features

A legend of used commands:

Alias Description
gcob git checkout -b. Evolved from gco -b. Creates a new branch from the current one.
gpush git push
gpull git pull
gsw [branch] git switch to a different branch. If no branch is specified, switches to the main branch, usually main or master.
gme [branch] git merge from a different branch. If no branch is specified, uses the main branch just like gsw.

Example:

# create a feature branch and switch to it
gcob feature-branch
# work on code
gpush
# switch back to the main branch and update it
gsw
gpull
# switch back to the feature branch and sync with the main
# the name is fully tabbable
gsw feature-branch
gme
gpush
# example: merge it back to the main branch
gsw
gme feature-branch
gpush
# tag it
git tag 1.2.3
gpush --tags

To see what files were created/modified I use gst — git status.

Working with submodules

Many of my projects include other repositories as submodules. The most common case is to include an associated GitHub wiki.

Alias Description
gpurr gpull, but pulls all submodules, checks out the main branch and pulls it effectively updating the reference.
gpwiki Similar to gpurr, but updates references only for submodules in directories called wiki and external_wiki.

Clone this wiki locally