Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将代码推送到Google Cloud remote repo git时,手动需要密码_Git_Google App Engine_Authentication_Gcloud - Fatal编程技术网

将代码推送到Google Cloud remote repo git时,手动需要密码

将代码推送到Google Cloud remote repo git时,手动需要密码,git,google-app-engine,authentication,gcloud,Git,Google App Engine,Authentication,Gcloud,上下文: 我尝试将我的代码推送到谷歌远程回购 从git bash,在我的项目文件夹中: 我运行了以下命令: git push --all google 我得到: fatal: remote error: Invalid username/password. You may need to use your OAuth token password; Note that generated google.com passwords are not compatible with private

上下文: 我尝试将我的代码推送到谷歌远程回购

从git bash,在我的项目文件夹中: 我运行了以下命令:

git push --all google
我得到:

fatal: remote error: Invalid username/password.
You may need to use your OAuth token password; Note that generated google.com passwords are not compatible with private repositories
调查

我在那里尝试了一个可能的解决办法

正如它所解释的,我尝试使用命令取消设置管理器设置,然后得到:

$ git config --system --unset credential.helper
error: could not lock config file C:\Program Files\Git\mingw64/etc/gitconfig: Permission denied
为了绕过这个被拒绝的权限,我在管理模式下运行了git bash,它成功了!!:斯迈利:

然后我尝试将代码推送到gcloud:

git push --all google 
Username for 'https://source.developers.google.com': "username input " `*( i put my gmail adress not sure if it's right thing)*`
然后在验证用户名后,我得到一个OpenSSH弹出窗口,询问我一些密码。。。。我试过gmail地址的那个…结果失败了

Username for 'https://source.developers.google.com': myadress@gmail.com
fatal: Authentication failed for 'https://source.developers.google.com/p/udacity-142622/r/udacity/'

你能帮忙吗??:皱眉:

假设您将Google Cloud git远程存储库添加为

git remote add google https://source.developers.google.com/p/PROJECT
那你就不得不这么做了

git config credential.helper gcloud.cmd
然后

因此

git push --all google
应该有用。这是假设

  • 您没有设置系统凭据帮助程序

    git config --system --unset credential.helper
    
  • gcloud
    在您的路径上,即

    where gcloud
    
    有点像

    ...\Google\Cloud SDK\google-cloud-sdk\bin\gcloud.cmd
    
  • 您使用
    gcloud
    设置了帐户,即

    gcloud config list --format="value(core.account)"
    
    显示你的username@domain.com.

  • 您可以使用上述帐户访问此项目,例如,您可以使用alpha命令列出项目中的所有回购

    gcloud alpha source repos list
    

  • 您是在使用GCE vm实例还是自己的机器?您使用的是什么git版本,以及如何为google配置git存储库(您使用了
    gcloud source repos clone
    还是遵循了这些要求)?我在本地计算机上;使用git版本2.8.2.windows.1,我尝试使用您提到的步骤链接,安装Gcloud,然后执行Gcloud初始化。。但由于我无法从gcloud更改目录,我选择了git。。将我的代码推送到云中的git repo。我拿git的原因;这也是因为我更喜欢使用git而不是gcloud。感谢第一个解决方案奏效,在我运行git config credential.helper gcloud.cmd之后,我不必完成其他凭据身份验证:),并且能够推送我的代码。
    gcloud alpha source repos list