【发布时间】:2020-10-12 05:39:57
【问题描述】:
问题
我在从 bitbucket 推送或拉取数据时遇到以下错误。
git fetch --all
Fetching origin
Forbidden
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我在 bitbucket 上的 ~/.ssh/project_ssh_key 和我的 mac 上有相同的 ssh 密钥。
我试图解决的问题
我尝试使用以下命令创建一个新的 ssh 文件并使用它。
eval "$(ssh-agent -s)"
ssh-add -K ~/.ssh/my_project_new_private_key
我已经在 ** Personal Settings --> ssh keys ** 中的 bitbucket 中添加了新创建的密钥 并粘贴了公钥,但没有运气。
我也尝试了ssh -T git@bitbucket 并得到了输出
logged in as chakreshwar
You can use git or hg to connect to Bitbucket. Shell access is disabled
在我执行以下操作之前,一切都在使用旧密钥
1. I realized that my RoR application is not using **.ruby-version** & **.ruby-gemset**
2. I created a new gemset & use that gemset.
3. Move all the references from default to newly created gemset.
4. Bundle install and rails s to make sure everything works.
5. Delete all the old git branches from local which are no longer in use.
【问题讨论】:
-
您能否运行
git remote -v并验证遥控器是否实际指向您要从中提取代码的位置? -
是的,没错
标签: ruby-on-rails git ssh bitbucket rvm