2 # Colorful git prompt for bash with symbols
4 Source `git-prompt.sh` into your bash session.
5 Prepend the following string to your PS1: `$(__git_prompt_print)`
9 You are standing on the master branch, which was committed 13 hours ago
10 and there were no changes so far.
11 ![master-clean](demo/master-clean.png)
13 Same as above, but there is 1 file ignored by git.
14 You can disable showing ignored files by setting `GIT_PROMPT_SHOW_IGNORED=` bash variable (empty string),
15 enable by `GIT_PROMPT_SHOW_IGNORED=1`.
16 ![master-clean-ignored](demo/master-clean-ignored.png)
18 A star next to the branch name indicates the branch is not in synchron with its upstream.
19 Either push or poll is needed or even the remote branch is not exists.
20 ![master-unpushed](demo/master-unpushed.png)
22 You are on an unsynchronized branch, which is ahead by 1 and behind by 5 commits from the master.
23 ![divergent-unpushed](demo/divergent-unpushed.png)
25 You are on an unsynchronized branch, which is ahead by 1 and behind by 14 commits from the master.
26 You have 1 untracked file (or directory) in the working tree.
27 ![unclean-untracked](demo/unclean-untracked.png)
29 You are on the master branch, but dev branch is also stays here.
30 The current commit has a tag.
31 ![branches-tag](demo/branches-tag.png)
33 You are on dev branch which is not pushed to the upstream.
34 ![branches-unpushed-tag](demo/branches-unpushed-tag.png)
36 There are changes in stage (plan icon), 1 file being added, 1 deleted, 1 edited, and 1 renamed in the next commit.
37 You can see how many lines are added and removed.
38 Only lines in text files are counted, not binary blocks.
39 You can disable the costly line counting operation by setting bash variable `GIT_PROMPT_COUNT_LINES=` (empty string), default is enabled.
40 ![branches-unpushed-tag-staged](demo/branches-unpushed-tag-staged.png)
42 The working tree is edited (pencil icon).
43 You can see the same status letters as in stage.
44 ![branches-unpushed-tag-unclean-staged](demo/branches-unpushed-tag-unclean-staged.png)
46 Full circle indicates stashed files.
47 ![branches-unpushed-stash-staged](demo/branches-unpushed-stash-staged.png)
49 You have unstaged, staged, and stashed changes.
50 ![branches-unpushed-unclean-stash-staged](demo/branches-unpushed-unclean-stash-staged.png)
52 You have 2 stash entries in a clean working tree.
53 ![branches-unpushed-stash](demo/branches-unpushed-stash.png)
55 You are in a detached HEAD state.
56 Current commint is behind the master branch by 3 commits.
57 ![detached-bybranch](demo/detached-bybranch.png)
60 Current commit is expressed by the relation to the next tag.
61 This is the default behavior if there is a tag, otherwise branch names are used.
62 ![detached-bytag](demo/detached-bytag.png)
64 You are in BISECT mode.
65 There is 1 merge conflict denoted by `U1`.
66 ![bisect-unclean-staged](demo/bisect-unclean-staged.png)
68 Current working directory is under `.git`.
69 You are also in MERGE mode.
70 ![gitdir-merge-divergent](demo/gitdir-merge-divergent.png)
72 There are 3 merge conflicts and 2 staging type changes.
73 ![merge-conflict-stash-typechange](demo/merge-conflict-stash-typechange.png)