git - 强制 Git 提示输入用户名和密码

标签 git authentication push google-code

我关闭了一个在 google code 上发布的 PHP 项目。

问题是当我尝试使用以下命令时:

git push origin master

我收到以下身份验证错误消息:

fatal: remote error: Invalid username/password.
You may need to use your generated googlecode.com password; see https://code.google.com/hosting/settings

如何强制 Git 提示输入用户名和密码以解决此问题?

最佳答案

参见 this answer .

转到您获取密码的错误消息中的 URL,然后按照说明进行操作。

For Git repositories, you can add the following line to your .netrc file recording your password for each repository domain you have commit access to. Make sure you have set the permissions on .netrc so that only your user account can read it.

machine code.google.com login user@gmail.com password qwertyasdfg

我还会在该答案下引用一条可能有帮助的评论:

removing the username from the .git/config forced git to reask for username and password

关于git - 强制 Git 提示输入用户名和密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13540063/

相关文章:

git - 如何使用 Unity Smart Merge merge 我的 Unity 场景?

最常见的 Mercurial 命令的 Git 等价物?

git - powershell + oh my posh + pure theme - git 目录中的磁盘字形意味着什么

php - 我的社交网络中的用户无法注册和登录

android - Glide : load image to push notifications

objective-c - 通话结束时 Skype 推送通知 "[person] is calling..."消失 - 怎么办?

Git 重写历史记录将文件夹和文件移动到父文件夹

authentication - 密码学:点对点游戏断开连接保护

javascript - 将一维数组插入二维数组的谷歌脚本

mysql 将身份验证插件设置重置为默认值