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

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

当我试着我返回这个错误:我在Windows7上运行Git2.6.3C:\opt\git-2.6.3和我。gitconfig——起初是空的。但在这个错误,它充满了:,我输入的每个命令,及时返回我同样的错误……我如何解决这个问题?与感恩,

原文:

When I try:

$ git config --global user.name "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:

[user]
name = Me

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

How can I fix this?

With gratitude,

网友:问题不在于git,但您的shell。检查你的。bash_profile(或任何其他配置文件)。同时,堆栈溢出实际上只有编程问题。你应该问这样的问题在超级用户。

(原文: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.)

网友:删除你。gitconfig文件并再次尝试该命令。如果你还看到一个错误,这是你的外壳像利奥说。如果是这样的话,我可能会建议重装Git。

(原文: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.)

网友:同样,除非你特别核对一个选项在Git安装过程中,默认的windows命令提示符可能不会有完整的功能。确保您使用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閛林我不相信这是八卦。问说:“我们觉得最好的堆栈溢出的问题有一些源代码”,但这“程序员常用软件工具”是公平的游戏。

(原文:@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.)

网友:作为@L閛Lam说,它可能是你的。bashrc一团糟。(如果要我猜,我想说一些提示(或许报失踪,或类似的东西)。

(原文: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).)