dahlbyk / posh-git

A PowerShell environment for Git
http://dahlbyk.github.io/posh-git/
MIT License
7.7k stars 801 forks source link

Disable color of git status #49

Closed viceice closed 12 years ago

viceice commented 12 years ago

Color should be explicitly disabled on "git status" call at GitUtils.ps1:104.

old: git status --short --branch new: git -c color.status=false status --short --branch

https://github.com/ViceIce/posh-git/commit/f034c69a818518ed89c2c6fa804b5c0103586d53

Regards

dahlbyk commented 12 years ago

Good suggestion - out of curiosity, what sort of problem did this cause?

viceice commented 12 years ago

If color is globally enabled, you got a branch named like: "[←[32mmaster←[m]".

dahlbyk commented 12 years ago

Come to think of it, I'm pretty sure that was reported maybe a year ago and I could never reproduce the issue - never occurred to me that it might be color. Thanks!

viceice commented 12 years ago

Here some examples:

$t = git -c color.status=always status --short --branch
$t

Result: ## ←[32mmaster←[m

$t = git -c color.status=false status --short --branch
$t

Result: ## master

The problem seems to be the color.status=always configuration, which i set an my global .gitconfig.

Regards

kaijurgeit commented 10 months ago

I had a similar issue:

$ git branch
* ←[32mmaster←[m

Solved it by typing:

$ git config --global color.branch false

Now:

$ git branch
* master

Thank you!