mirror of
https://github.com/jakubpawlowicz/git-cheat-sheet.git
synced 2025-12-19 22:29:00 +02:00
Fixes branch status code
This commit is contained in:
@@ -230,10 +230,10 @@ git config --global color.status auto
|
|||||||
git config --global color.branch auto
|
git config --global color.branch auto
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Branch name and merge status in bash prompt - it goes to ~/.bash_profile
|
#### Branch name and merge status in bash prompt (should go to local or global bash profile)
|
||||||
```shell
|
```shell
|
||||||
function parse_git_dirty {
|
function parse_git_dirty {
|
||||||
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
|
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "*"
|
||||||
}
|
}
|
||||||
function parse_git_branch {
|
function parse_git_branch {
|
||||||
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
|
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
|
||||||
|
|||||||
Reference in New Issue
Block a user