matthewmccullough/scripts — pull request #10 by leewillis77 (2014-06-04 17:13:02+00:00)
Title: Add additional functions to git-completion script

The changes add two additional functions that can be used to add repository specific information to your prompt - specifically the repository name, and the file path within the respository. This allows you to create useful prompts like this (Where "26-things" is the repo, "master" is the branch", and "images/" is the sub-folder within the repo:

![image](https://cloud.githubusercontent.com/assets/1097338/3177029/4722dec6-ec0b-11e3-8a41-d919bd9489f0.png)

Which all falls back to something sensible when not inside a git repo:

![image](https://cloud.githubusercontent.com/assets/1097338/3177034/5df9c6d2-ec0b-11e3-8ced-e336677abd13.png)

Example PS1:
`export PS1="\[\e[1;31m\]\$(__git_repo_name)\[\e[0m\]\[\e[1;33m\]\$(__git_ps1 \"%s: \")\[\e[0m\]\[\e[1;37m\]\$(__git_path_in_repo)\[\e[0m\] \$ "`