我在Windows操作系统上安装了GCM(Git凭据管理器)。使用它,我可以成功push
到GitLab和Bitbucket信息库。但是关于Azure DevOps:
>git push Azure master
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
然后提示输入用户名(独立于GCM)。
有痕迹:
>SET GIT_TRACE=1
>SET GCM_TRACE=1
>git push Azure master
17:34:02.362309 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
17:34:02.364307 git.c:415 trace: built-in: git push Azure master
17:34:02.370303 run-command.c:637 trace: run_command: GIT_DIR=.git git remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.382598 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:02.383601 git.c:671 trace: exec: git-remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.384601 run-command.c:637 trace: run_command: git-remote-https Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android
17:34:02.399961 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:03.391539 run-command.c:637 trace: run_command: 'git credential-manager get'
17:34:03.613232 exec-cmd.c:236 trace: resolved executable dir: C:/Program Files/Git/mingw64/libexec/git-core
17:34:03.615233 git.c:671 trace: exec: git-credential-manager get
17:34:03.615233 run-command.c:637 trace: run_command: git-credential-manager get
17:34:03.698676 ...\Common.cs:744 trace: [Main] git-credential-manager (v1.18.0) 'get'
17:34:03.793588 ...\Git\Where.cs:348 trace: [FindGitInstallations] found 1 Git installation(s).
17:34:03.802579 ...Configuration.cs:222 trace: [LoadGitConfiguration] git All config read, 38 entries.
17:34:03.809873 ...\Common.cs:543 trace: [LoadOperationArguments] useHttpPath = ''.
17:34:03.879804 ...\Common.cs:85 trace: [CreateAuthentication] detecting authority type for 'https://mirismaili.visualstudio.com/OpenLib/_git/Android'.
17:34:04.749863 ...uthentication.cs:229 trace: [DetectAuthority] detected 'https://mirismaili.visualstudio.com/' as Azure DevOps from GET response.
17:34:04.757022 ...\Program.cs:601 trace: [Run] ! error: 'Object reference not set to an instance of an object.'.
17:34:04.760018 ...\Common.cs:709 trace: [LogEvent] System.NullReferenceException: Object reference not set to an instance of an object.
at AzureDevOps.Authentication.Authentication.<DetectAuthority>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at AzureDevOps.Authentication.Authentication.<GetAuthentication>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.CommonFunctions.<CreateAuthentication>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.CommonFunctions.<QueryCredentials>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Alm.Cli.Program.<<Get>b__24_0>d.MoveNext()
17:34:04.769048 ...\Program.cs:601 trace: [Run] fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
fatal: NullReferenceException encountered.
Object reference not set to an instance of an object.
17:34:04.793392 run-command.c:637 trace: run_command: bash -c 'test "a$SHELL" '\!'= "a${SHELL%.exe}" || exit 127; cat >/dev/tty && read -r line </dev/tty && echo "$line"'
其他有用信息:
>git remote -v
Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android (fetch)
Azure https://mirismaili.visualstudio.com/OpenLib/_git/Android (push)
BitBucket https://mirismaili@bitbucket.org/mirismaili/androidopenlib.git (fetch)
BitBucket https://mirismaili@bitbucket.org/mirismaili/androidopenlib.git (push)
GitLab https://mirismaili@gitlab.com/OpenLib/android.git (fetch)
GitLab https://mirismaili@gitlab.com/OpenLib/android.git (push)
>git version
git version 2.19.1.windows.1
>git credential-manager version
Git Credential Manager for Windows version 1.18.0
>git config -l
core.symlinks=false
core.autocrlf=true
core.fscache=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
help.format=html
rebase.autosquash=true
http.sslbackend=schannel
diff.astextplain.textconv=astextplain
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
core.editor='C:\Program Files\Notepad++\notepad++.exe' -multiInst -notabbar -nosession -noPlugin
user.name=S. Mahdi Mir-Ismaili
user.email=s.m.mirismaili@gmail.com
gui.recentrepo=D:/I/Documents/CryptoCurrenciesSimulator
credential.usehttppath=true
credential.helper=manager
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.Azure.url=https://mirismaili.visualstudio.com/OpenLib/_git/Android
remote.Azure.fetch=+refs/heads/*:refs/remotes/Azure/*
branch.master.remote=BitBucket
branch.master.merge=refs/heads/master
remote.BitBucket.url=https://mirismaili@bitbucket.org/mirismaili/androidopenlib.git
remote.BitBucket.fetch=+refs/heads/*:refs/remotes/BitBucket/*
remote.GitLab.url=https://mirismaili@gitlab.com/OpenLib/android.git
remote.GitLab.fetch=+refs/heads/*:refs/remotes/GitLab/*
另一个注意事项是,我可以使用Visual Studio Team Services plugin for IntelliJ IDEs推送到Azure remote
。
答案 0 :(得分:2)
答案 1 :(得分:1)
嗨
从今天开始,我所有的Azure-DevOps-Repos都遇到相同的问题。 我相信这是指从Visual Studio Team Services到DevOps的转变。
我的解决方法如下:
git config --global credential.helper store
我登录了DevOps帐户并创建了一个新的个人访问令牌
我打开了一个存储库并执行了另一个提取
在NullReferenceException提示后,我输入了用户名,并将创建的访问令牌粘贴到了密码提示中。
现在,在与遥控器的每次交互中,我都会得到两个NullReferenceException-Prompts,但现在它适用于我所有的Azure-DevOps-Repos ...
我不知道这与其他Repo-Service(如GitHub等)如何配合。我只使用Azure ...
这只是一个快速且肮脏的解决方法。因此,如果有人可以分享更好的解决方案,我将不胜感激。
谢谢