推送分支时git错误:身份验证失败:意外令牌附近的语法错误')'

时间:2016-01-14 17:44:13

标签: git azure-devops

在git中,当我尝试将分支从本地计算机推送到原点时,我正在使用此命令:

git push origin MSMQtoAzure

然后提示我输入我的VSO用户ID和密码。我知道信用证是有效的,因为我一直都在使用它们。但是,我在命令提示符下得到了这个:

fatal: Authentication failed for <url>
bash: command substitution: line 1: syntax error near unexpected token ')'
bash: command substitution: line 1: '__git_ps1)'

这是我的git.config文件的全部内容(删除了一些敏感部分)

[core]
    bare = false
    filemode = false
    symlinks = false
    ignorecase = true
    logallrefupdates = true
[core]
    repositoryformatversion = 0
[remote "origin"]
    url = https://<redacted>.com/defaultcollection/Response%20(Git)/_git/Main
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "origin"]
[branch "master"]
    remote = origin
[branch "master"]
    merge = refs/heads/master
[branch "LeadSubmission"]
    remote = origin
[branch "LeadSubmission"]
    merge = refs/heads/LeadSubmission
[gui]
    wmstate = normal
    geometry = 887x427+1984+334 369 192
[branch "ChangeXToY"]
    remote = origin
[branch "ChangeXToY"]
    merge = refs/heads/ChangeXToY
[branch "MSMQtoAzure"]
    remote = origin
[branch "MSMQtoAzure"]
    merge = refs/heads/MSMQtoAzure

修改

我的密码中有$符号。可能是问题吗?我试图逃避它。说密码是123 $ 456。我已经尝试了以下所有方法:

  • 123 / $ 456
  • 123 \ $ 456
  • 123` $ 456

1 个答案:

答案 0 :(得分:1)

从Git命令提示符使用VSO Git Repo时,您需要使用Personal Access TokenAlternate Authentication

为方便起见,您可以安装Git Credential Manager。它将提示VSO登录对话框,然后您可以直接输入您的VSO用户名和密码。