You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-7Lines changed: 20 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,21 @@
1
1
# Git Aware Prompt
2
2
3
-
Working with Git and its great branching/merging features is amazing. Constantly switching branches can be confusing though as you have to run `git status` to see which branch you're currently on.
3
+
Working with Git and its great branching/merging features is
4
+
amazing. Constantly switching branches can be confusing though as you have to
5
+
run `git status` to see which branch you're currently on.
4
6
5
-
The solution to this is to have your terminal prompt display the current branch. There's a [number][1][of][2][articles][3][available][4] online about how to achieve this.
7
+
The solution to this is to have your terminal prompt display the current
8
+
branch. There's a [number][1][of][2][articles][3][available][4] online
9
+
about how to achieve this.
6
10
7
11
I based this project mainly on Aaron Crane's [solution][1].
8
12
9
13
10
14
## Overview
11
15
12
-
If you `cd` to a Git working directory, you will see the current Git branch name displayed in your terminal prompt. When you're not in a Git working directory, your prompt works like normal.
16
+
If you `cd` to a Git working directory, you will see the current Git branch
17
+
name displayed in your terminal prompt. When you're not in a Git working
18
+
directory, your prompt works like normal.
13
19
14
20

15
21
@@ -28,21 +34,28 @@ Edit your `~/.profile` or `~/.bash_profile` and add the following to the top:
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][5] how-to.
45
+
If you followed the above installation instructions, you've added the default
46
+
prompt style already by defining the `PS1` variable. If you don't know how to
47
+
customize your prompt, I recommend you check [this][5] how-to.
39
48
40
-
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`.
49
+
Basically, to have the current Git branch shown, simply add `$git_branch` to
50
+
your `PS1` variable, and make sure the variable value is defined with double
51
+
quotes. A set of color variables have also been set for you to use. For a list
52
+
of available colors check `colors.sh`.
41
53
42
54
43
55
## License
44
56
45
-
(MIT-like license, without the requirement to keep copyright notice in reproductions)
57
+
(MIT-like license, without the requirement to keep copyright notice in
0 commit comments