【问题标题】:GIT push Unauthorized when SSH keys already added已添加 SSH 密钥时 GIT push 未授权
【发布时间】:2020-10-06 17:19:36
【问题描述】:

我没有设置任何分支权限,我也已经在 BitBucket SSH 设置中添加了公钥。

┌──[forge@app]──[~/app]                                                                  
└── git status                                                                               
On branch master                                                                             
Your branch is ahead of 'origin/master' by 2 commits.                                        
  (use "git push" to publish your local commits)                                             
nothing to commit, working directory clean                                                   
┌──[forge@app]──[~/app]                                                                  
└── git push origin master                                                                   
Unauthorized                                                                                 
fatal: Could not read from remote repository.                                                

Please make sure you have the correct access rights and the repository exists.                                                                   
┌──[forge@app]──[~/app]                                                                  
└──  

我一直得到

未经授权
致命:无法从远程存储库中读取。
请确保您具有正确的访问权限并且存储库存在。

【问题讨论】:

    标签: git ssh bitbucket ssh-keys


    【解决方案1】:

    首先检查你的current remote URL

    cd ~/app
    git remote -v
    

    应该是git@bitbucket.org:<me>/<myproject>

    然后检查输出:

    ssh -Tv git@bitbucket.org
    

    你会看到你是否被正确认证。

    【讨论】:

      猜你喜欢
      • 2018-11-18
      • 2013-07-23
      • 1970-01-01
      • 2014-01-18
      • 1970-01-01
      • 2018-03-15
      • 1970-01-01
      • 2017-11-06
      • 1970-01-01
      相关资源
      最近更新 更多