https://github.com/kyleburton/krb-bash-utils
My Bash utilities and profile settings (including git status in the prompt)
https://github.com/kyleburton/krb-bash-utils
Last synced: 5 months ago
JSON representation
My Bash utilities and profile settings (including git status in the prompt)
- Host: GitHub
- URL: https://github.com/kyleburton/krb-bash-utils
- Owner: kyleburton
- Created: 2009-04-02T13:57:52.000Z (almost 17 years ago)
- Default Branch: master
- Last Pushed: 2010-04-23T11:51:51.000Z (over 15 years ago)
- Last Synced: 2025-01-29T05:43:17.811Z (12 months ago)
- Language: Shell
- Homepage:
- Size: 102 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Bash functions and customizations that I've found useful and need everywhere I
do work in the shell.
Git Status in the Bash Prompt
========================================
This is based off of the example from gitready.com:
http://henrik.nyh.se/2008/12/git-dirty-prompt
I keep my $HOME directories checked in to their own Git repository, with a
branch named `home'. I've added a check to the above so the prompt shows not
just which branch, but a `[---]' when I'm in a directory not tracked by the
current git repository.
Eg, in a clean $HOME:
kburton@kburton-lin ~[home]$
in a dirty $HOME:
kburton@kburton-lin ~[home*]$
in my ~/tmp directory (untracked):
kburton@kburton-lin ~/tmp[---]$
in a clean sub (git) project directory (branch is master):
kburton@kburton-lin ~/projects/krb-bash-utils[master]$