Skip to content

Instantly share code, notes, and snippets.

@coridrew
Last active February 6, 2023 16:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coridrew/bb1d6e8ca92df71fb335e16441705c53 to your computer and use it in GitHub Desktop.
Save coridrew/bb1d6e8ca92df71fb335e16441705c53 to your computer and use it in GitHub Desktop.
gitk is my favorite git gui, and is available on all platforms for free. Here are some of the helpful switches I've learned over the years.

> gitk -> Visualize current working directory / branch only.

> gitk --reflog -> VISUALIZE YOUR REFLOG! OMG! Thanks @Stjaertfena

> gitk --all -> Visualize current working directory & ALL branches (both local and remote).

> gitk --remotes -> Visualize ALL REMOTE branches only.

> gitk --remotes=origin/cd_* -> Visualize SPECIFIC (pattern-based!) REMOTE branches only.

> gitk --branches -> Visualize ALL LOCAL branches only.

> gitk --simplify-by-decoration -> Only show decorated commits (branch tips/tags) for local branch lineage.

> gitk --all --simplify-by-decoration -> Only show decorated commits (branch tips/tags) for ALL branches.

> gitk branch1 branch2 -> Shows the commit history for the specified branches.

> gitk HEAD~10..HEAD -> Shows the commit history for the last 10 commits.

> gitk --since=2.weeks -> Shows the commit history for the past 2 weeks.

> gitk --author='John Doe' -> Shows the commit history for commits authored by "John Doe" on current branch.

> gitk --author=Cori -> Shows the commit history for commits authored by ci search for cori on current branch.

> gitk --grep='fix' -> Shows the commit history for commits that contain the string "fix" in the commit message.

> gitk -- file1 file2 -> Shows the commit history for the specified files.

> gitk filepath Shows history for file (but no workie if deleted)
> gitk -- filepath Shows history for DELETED file

Gitk links / learning / reading / reference:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment