My actual problem is that i have made git repository in my VS2010 project and when ever i want to commit solution then this error happened " bad config value for 'color.diff' " i have checked .gitconfig but there is no color.diff value. I have searched from internet and from Git Source Control Provider too but could not find out exact solution to my problem.
-
Does this happen in every repository, or just that single one? – IQAndreas Oct 25 '12 at 06:52
-
What does `git config color.diff` show? – CB Bailey Oct 25 '12 at 07:02
-
I suggest you to read http://git-scm.com/book/en/Customizing-Git-Git-Configuration – Ammar Raja Oct 25 '12 at 07:18
-
@IQAndreas i just tested it out for single one – Ammar Raja Oct 25 '12 at 07:20
2 Answers
I have solved my problem out after trying using Git Bash :) The error was showing because there was no color set for my color.diff value and after setting it to true and giving it to color i solved my problem out.
here is the command for setting color.diff.
$ git config --global color.diff.meta “blue bold”

- 1,284
- 5
- 14
- 23
-
I just opened the Git Bash(Command Line) by clinking on git master from VS2010 project and tried to enter color.diff to set its value true and then set the color for this and i solved out :) – Ammar Raja Oct 25 '12 at 07:13
As you have already realized, this error is occurring because somewhere in the config file there is a "bad" value (likely a misspelling or forgotten line break).
There are two places where this could be happening:
- In your global gitconfig - in this case the error occurs in all projects. This answer covers how to find the file
- In your local gitconfig - if the error only occurs in that single project. It can be found in your project's directory under
.git/config
Open this file with a standard text editor, or you can do so automatically from the command line using one of these lines (for the global and local config files, respectively):
git config --global --edit
git config --edit
Find a block of code that looks like this:
[color]
diff = auto
status = auto
branch = auto
In my case, diff
is set to auto
. Double check what your value is, and either change it to auto
or remove the line completely to use the default value.
-
I agreed what you said but after trying again in Git Bash i have solved my problem...Please read my answer for the exact solution i wanted. – Ammar Raja Oct 25 '12 at 07:06