git - Atlassian Bitbucket - ssh - git pull 工作,git push 失败
问题描述
1. 总结问题
我按照 Bitbucket 的说明设置 ssh。
我有一个 pub/priv 密钥对,并将 pub 密钥粘贴到项目的 Bitbucket 设置(访问密钥)中。
我在 GCE VM 上有一个构建服务器。 git clone
工作成功,并且git pull origin master
有效。我正在使用密码。
git commit
但是,如果我在 GCE VM 上对单个文件进行小改动,然后执行git push origin master
,则会失败并显示以下错误消息。
Enter passphrase for key '/home/proc/.ssh/id_rsa':
Unauthorized
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git remote -v
节目
origin git@bitbucket.org:<my-account>/<my-repo>.git (fetch)
origin git@bitbucket.org:<my-account>/<my-repo>.git (push)
如果git pull origin master
工作正常,则 ssh 设置正确。
我添加了以下文件:$HOME/.ssh/.config
,内容如下,但没有帮助。
Host bitbucket.org
IdentityFile ~/.ssh/id_rsa
我的密钥文件是使用以下内容生成的:
ssh-keygen -t rsa -b 4096 -C "<comment>"
2. 提供背景,包括您已经尝试过的内容
我有关于 Bitbucket 身份验证问题的所有堆栈溢出文章。
3.显示一些代码
git add <changed file>
git commit -m "made some updates"
git push origin master
4. 描述预期的实际结果,包括任何错误消息
我正在尝试git push origin master
bitbucket。
解决方案
推荐阅读
- vba - 宏打开另存为窗口并自动填充文件名和类型
- javascript - 打开图层地图,经纬度获取地址
- java - 截击回调
- vba - 插入行后的VBA剪切/粘贴
- reactjs - componentDidMount Jest 中的测试 Promise 错误
- tfs - 任务链接到更改时未发送 TFS 警报
- tensorflow - 你能训练 TensorFlow 对象检测 API 来检测对象的各个部分吗?
- .net - 由于“project.assets.json”没有针对 .NETCoreApp 的目标,TFS-CI 构建失败,Version2.0
- hive - Hive SQL 给出无关输入 ',' 期望 ')' 错误
- javascript - 将 AJAX 调用返回的日期数组“展平”以在 DataTables 1.09 中使用