git配置——全球回报?意想不到的令牌)的附近语法错误吗?错误 - git config --global returns “syntax error near unexpected token `)'” error

- 此内容更新于:2016-02-03



When I try:

$ git config --global "Me"

it returns me this error:

bash: command substitution: line 1: syntax error near unexpected token `)'
bash: command substitution: line 1: `__git_ps1)'

I'm running Git 2.6.3 on Windows 7 at C:\opt\git-2.6.3 and my .gitconfig was - at first - empty.

But, beside this error, it was filled with:

name = Me

and, for each command that I type, the Prompt returns me the same error...

How can I fix this?

With gratitude,


(原文:The problem is not with git, but with your shell. Check your .bash_profile (or any other config file). Also, Stack Overflow is actually only for programming questions. You should ask this sort of questions on Super User instead.)


(原文:Delete your .gitconfig file and try that command again. If you still see an error, it's your shell like Leo said. If this is the case, I might suggest re-installing Git.)


(原文:Also, unless you specifically check off an option during the Git install process, the default windows command prompt will probably not have full functionality. Ensure you are using the Git command prompt.)


(原文:@LéoLam I don't believe this is off-topic. Asking says "we feel the best Stack Overflow questions have a bit of source code in them", but that "software tools commonly used by programmers" is fair game.)


(原文:As @LéoLam said, it's probably your .bashrc that's messed up. If I had to guess, I'd say something with the prompt (perhaps a quote missing, or something similar).)