You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

终端中Bitbucket登录认证失败,重装系统后克隆仓库报错

Bitbucket克隆仓库认证失败解决办法

错误信息

remote: Login failed due to incorrect login credentials or method.
remote: If you are unsure of which login details or login method to use, visit:
remote: https://support.atlassian.com/bitbucket-cloud/docs/log-into-or-connect-to-bitbucket-cloud/
fatal: Authentication failed for 'https://bitbucket.org/xxxxxxx/repository.git/'

解决步骤

  • 验证账号密码有效性
    先登录Bitbucket网页端确认账号密码正确。如果密码没问题,Bitbucket已不再支持直接用账号密码进行Git操作,必须改用App Password。

  • 创建并使用App Password

    1. 登录Bitbucket网页端,进入「个人设置」
    2. 找到「App passwords」选项,点击创建新密码
    3. 勾选克隆仓库所需的权限(至少选「Repository read」)
    4. 生成后复制该密码,克隆仓库时用它替代原账号密码
  • 清理本地Git凭据缓存
    重装系统后可能残留无效凭据,按系统类型执行对应操作:

    # Windows:用凭据管理器删除Bitbucket相关条目,或执行
    git config --global credential.helper wincred
    
    # macOS:执行命令删除缓存
    security delete-generic-password -s bitbucket.org
    
    # Linux:清理缓存
    git credential-cache exit
    
  • 改用SSH克隆(替代方案)
    若不想用HTTPS方式,可配置SSH密钥:

    1. 生成SSH密钥对:ssh-keygen -t ed25519 -C "你的邮箱地址"
    2. 将生成的公钥(路径通常为~/.ssh/id_ed25519.pub)添加到Bitbucket个人设置的SSH密钥列表中
    3. 使用SSH地址克隆:git clone git@bitbucket.org:xxxxxxx/repository.git

内容的提问来源于stack exchange,提问作者Niyaz

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 13:50:32