Git Bash Prompt

Posted by: Matthew McCullough on 08/18/2010

I’ve recently been asked about my Bash prompt (derived from a conglomerate of similar OSS solutions) that shows off the current Git branch and the status in the prompt. Here is my version for both Mac and Unix.

gist: 48058 Windows (Cygwin) Show Git dirty status in your Unix bash prompt
gist: 47267 Show Git dirty status in your Unix bash prompt (symbols not compatible with CygWin)


About Matthew McCullough

Matthew McCullough

Matthew McCullough is an energetic 15 year veteran of enterprise software development, open source education, and co-founder of Ambient Ideas, LLC, a Denver consultancy. Matthew currently is a trainer for GitHub.com, author of the Git Master Class series for O'Reilly, speaker at over 30 national and international conferences, author of three of the top 10 DZone RefCards, and President of the Denver Open Source Users Group. His current topics of research center around project automation: build tools (Maven, Leiningen, Gradle), distributed version control (Git), Continuous Integration (Hudson) and Quality Metrics (Sonar). Matthew resides in Denver, Colorado with his beautiful wife and two young daughters, who are active in nearly every outdoor activity Colorado has to offer.

More About Matthew »

NFJS, the Magazine

December Issue Now Available
  • BDD and REST

    by Brian Sletten
  • Mocks and Stubs in Groovy Tests

    by Kenneth Kousen
  • Algorithms for Better Text Search Results

    by John Griffin
  • Knowns and Unknowns of Scrum and Agile

    by Brian Tarbox
Learn More »