Wilson Mar bio photo

Wilson Mar

Hello. Hire me!

Email me Calendar Skype call 310 320-7878

LinkedIn Twitter Gitter Google+ Instagram Youtube

Github Stackoverflow Pinterest

Helps you do your job


This page explains files in my git-utilities repo.

On a Mac:

  1. Get the repo onto your machine using a Git UI or in a Git command line:

    git clone https://github.com/wilsonmar/git-utilities
  2. cd into the repo.

  3. (If you don’t have it already) create a folder on the operating system’s path by copying the git-custom-commands folder from within the Git repository into a folder in your home directory.

    Linux people often use /opt/bin, but on a Mac that is a protected area requiring sudo access.

    create a folder under your $HOME folder and put that folder within the system path.

  4. On a Mac, edit file ~/.bash_profile so the custom command files will be found when they are run on any folder.

    PROTIP: git automatically make files available as a subcommand, just like regular executable scripts.

  5. Exit terminal session windows or re-run the Terminal initialization:

    source ~/.bash_profile
  6. cd into the git-custom-commands folder.

  7. Set permissions to execute each file:

    chmod 555 *
  8. Try the git-echo command, created just so we can verify whether we have it working:

    git echo "hello"

    You should see response:


    Instead of “hello”, you can type in any phrase.

Python program

A cross-platform Python can be executed.


Seth House did several videos on Git and GitHub, in which he showed use of a utility to create a visualization from the command line. He was nice enough to share it with me.

  1. Install GraphViz using a package manager. On a Mac:

    brew install graphviz

    This installs dependencies libtiff, webp, gd

    • http://www.graphviz.org/Download_macos.php - graphviz-2.40.1.pkg
    • http://www.graphviz.org/Download_windows.php

  2. Save the file from a text editor into folder

    Alternately, copy the file graph-dag into that folder from the cloned folder.

  3. Set permissions to execute the file:

    chmod a+x graph-dag
  4. Run the graph-dag that outputs a commit graph using the GraphViz “dot” tool:

    git graph-dag HEAD~10.. | dot -Tpng > mygraph.png
  5. Additionally, look at the other utilities at:


    • Sorting commits by commit message line count / changed lines ratio
    • Copying all changed files from the last N commits
    • Setting the timestamps of the files to the commit timestamp of the commit which last touched them

Visualization of branches

git log does a good job of illustrating branches, but GitKraken provides this colorful branch graphics:

git-utilities gitkraken dag 579x279

  • The master branch is the light-blue line on the left.

  • The Bug fix branch is the darker-blue line to the right of that.

  • The develop branch is the purple line to the right of that.


Make some ASCII art from (part of your) history

A - B - C
  \       \
    D - E - F


This is one of a series on Git and GitHub:

  1. Git and GitHub videos

  2. Why Git? (file-based backups vs Git clone)
  3. Git Markdown text
  4. Git basics (script)
  5. Git command shortcuts

  6. Git-client based workflows
  7. Git whoops (correct mistakes)
  8. Git rebase
  9. Git interactive merge (imerge)
  10. Git HEAD (Commitish references)
  11. Git commits with a Tag and Signature

  12. Git custom commands
  13. Git utilities
  14. Git hooks

  15. GitHub data security

  16. TFS vs GitHub
  17. GitHub REST API
  18. GitHub GraphQL API
  19. GitHub PowerShell API Programming
  20. GitHub GraphQL PowerShell Module