我开始使用Visual Studio Code,我试图将我的测试项目保存到GitHub,但Visual Studio Code总是要求我的GitHub凭据.
我已经安装在我的PC GitHub Desktop和Git中,我已经运行:
git config --global credential.helper wincred
Run Code Online (Sandbox Code Playgroud)
但仍然Visual Studio Code要求提供凭据.
有帮助吗?
这是我的.gitconfig文件,位于用户配置文件中:
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[user]
name = ddieppa
[user]
email = fake@live.com
[credential]
helper = wincred
Run Code Online (Sandbox Code Playgroud)
以下是要求凭据的弹出窗口:
我在弹出窗口中输入了我的GitHub凭据,但仍然在Visual Studio代码的Git输出窗口中出现此错误:
remote: Anonymous access to ddieppa/LineOfBizApp.git denied.
fatal: Authentication failed for 'https://github.com/ddieppa/LineOfBizApp.git/'
Run Code Online (Sandbox Code Playgroud) 之前发生了几次,我已经两次打开同一个文件而忘了它.这意味着我在两个窗格中编辑同一个文件,这意味着同一个文件的两个版本.这导致了错误,我不明白为什么我的代码没有正常运行.
是否有设置阻止同一个文件打开两次?
在 Windows 上运行 VS Code 1.0.0,尝试使用 SSH 身份验证推送到 bitbucket。
问题类似于: 在 Visual Studio Code 上使用 <git push>,但显示“无法从远程存储库读取”。
但是,在我的情况下,凭据/User/profile/.ssh已经在我的 bitbucket 帐户中,如果我CTRL+ SHIFT+ P,CTRL+ SHIFT+C在 windows cli 中一切正常。
实际上,似乎我尝试过的所有其他方法似乎都可以获取这些凭据,例如 git gui 和其他 gui 工具。VS Code 似乎是唯一的异常值。
VS Code 尝试使用哪些凭据?那可以配置吗?
编辑:在fetch/pull/pushfrom Code期间使用 Process Monitor 查找对关键文件的访问似乎只显示/User/profile/.ssh/id_rsa正在查找,这是正确的键。
我希望 VS Code 在尝试使用该密钥后提示输入凭据,但是,仍然得到 Permission Denied (publickey)
运行 Windows 8.1 64 位并安装以下软件:
我的个人 SSH 密钥(位于%USERPROFILE%\.ssh)已生成并添加到我的 GitHub 帐户。.bashrc位于%USERPROFILE已修改为添加这些行:
# Start ssh-agent to allow git to be used
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa_personal
Run Code Online (Sandbox Code Playgroud)
我在 git 存储库中启动 Git Bash (MINGW64)。现在对文件进行更改,git add并对git commit我git push的 git 存储库进行更改...并且工作正常!
对于标准 Windows 命令提示符,我创建了一个bashrc.cmd使用以下代码调用的文件:
rem Start ssh-agent to use git from the Windows command line
set GIT_PATH=C:\Program Files\Git
call "%GIT_PATH%\cmd\start-ssh-agent.cmd"
call …Run Code Online (Sandbox Code Playgroud)