mirror of
https://github.com/jimeh/git-aware-prompt.git
synced 2026-02-19 13:36:38 +00:00
updated readme
This commit is contained in:
24
README.md
24
README.md
@@ -4,7 +4,7 @@ Working with Git and it's great branching/merging features is amazing. Constantl
|
||||
|
||||
The solution to this is to have your terminal prompt display the current branch. There's a [number][1] [of][3] [articles][3] [available][4] online about how to achieve this.
|
||||
|
||||
I based this project mainly on [Aaron Crane's solution][1].
|
||||
I based this project mainly on Aaron Crane's [solution][1].
|
||||
|
||||
[1]: http://aaroncrane.co.uk/2009/03/git_branch_prompt/
|
||||
[2]: http://railstips.org/2009/2/2/bedazzle-your-bash-prompt-with-git-info
|
||||
@@ -12,6 +12,15 @@ I based this project mainly on [Aaron Crane's solution][1].
|
||||
[4]: http://www.intridea.com/2009/2/2/git-status-in-your-prompt
|
||||
|
||||
|
||||
## Overview
|
||||
|
||||
If you `cd` to a Git working directory, you will see the current Git branch name displayed in your terminal prompt like so:
|
||||
|
||||

|
||||
|
||||
When you're not in a Git working directory, your prompt works like normal.
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
Clone the project to a `.bash` folder in your home directory:
|
||||
@@ -24,19 +33,14 @@ Edit your `~/.bash_profile` or `~/.profile` and add the following to the top:
|
||||
source $DOTBASH/main.sh
|
||||
PS1="\u@\h:\w\[$txtcyn\]\$git_branch\[$txtrst\]\\$ "
|
||||
|
||||
Configure your prompt by editing the `PS1 variable`. For a list of available colors check `colors.sh`.
|
||||
|
||||
## Configuring
|
||||
|
||||
## Screenshot
|
||||
If you followed the above installation instructions, you've added the default prompt style already by defining the `PS1` variable. If you don't know how to customize your prompt, I recommend you check [this][1] how-to.
|
||||
|
||||

|
||||
Basically, to have the current Git branch shown, simply add `$git_branch` to your `PS1` variable, and make sure the variable value is defined with double quotes. A set of color variables have also been set for you to use. For a list of available colors check `colors.sh`.
|
||||
|
||||
|
||||
## Issues
|
||||
|
||||
Please report any issues and bugs [here][1] on GitHub.
|
||||
|
||||
[1]: http://github.com/jimeh/git-branch-in-prompt/issues
|
||||
[1]: http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html
|
||||
|
||||
|
||||
## License
|
||||
|
||||
Reference in New Issue
Block a user