加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

用于Windows的Git bash不提示输入密码

发布时间:2020-12-14 03:52:00 所属栏目:Windows 来源:网络整理
导读:我是学生,也是版本控制软件的新手,所以我很难搞清楚这一点.我正在使用Google代码 Git存储库.要访问此存储库,我在Windows 7上使用Git Bash.问题是,当我到达推送步骤时,我没有被提示输入密码.例如: 首先,我设置如下全局变量: git config --global user.name
我是学生,也是版本控制软件的新手,所以我很难搞清楚这一点.我正在使用Google代码 Git存储库.要访问此存储库,我在Windows 7上使用Git Bash.问题是,当我到达推送步骤时,我没有被提示输入密码.例如:

首先,我设置如下全局变量:

git config --global user.name "Your Name"
git config --global user.email youremail@gmail.com

克隆

$git clone https://UserName@code.google.com/p/repository/

然后我对文件进行了更改/添加了新文件等并添加了

$git add .

承诺

$git commit -m "Message"

拉扯以确保我是最新的

$git pull
Already up-to-date.

但是当我推动时,我没有提示输入密码

$git push origin master
fatal: remote error: Invalid username/password.
You may need to use your generated googlecode.com password; see https://code.goo
gle.com/hosting/settings

有什么建议?谢谢.

解决方法

修改:看起来您无法通过在网址中添加用户名来成功访问Google代码(至少截至2011年8月),请参阅: netrc not accepted by git

那说,这可能会奏效:

取自上面显示的URL(您必须访问the site):

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 blah.blah@gmail.com password mypasswordXXX123

一旦你有了上面的项目,它看起来像在Git Bash中你应该能够像这样更新你的_netrc文件:

echo“machine code.google.com login blah.blah@gmail.com password mypasswordXXX123”> $HOME / _netrc

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读