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

Bitbucket Git克隆认证失败求助:HTTPS/SSH命令均无法执行

Fixing Bitbucket "remote: Unauthorized / fatal: Authentication failed" When Cloning via Git

Hey Anthony, let's walk through how to fix this authentication error you're facing when trying to clone your Bitbucket repo via the command line. I’ve dealt with this exact issue a few times, so here are the most reliable solutions sorted by authentication method:

For HTTPS Cloning

  • Clear cached Git credentials
    Windows often caches old or incorrect credentials. Run this command to reset the credential manager:

    git credential-manager uninstall
    

    After running this, re-execute your clone command. You should get a prompt to enter your Bitbucket username and an App Password (note: you can't use your regular Bitbucket account password anymore—generate an App Password in your Bitbucket account settings under "App passwords").

  • Manually specify credentials in the clone command
    If the credential prompt doesn’t appear, you can embed your credentials directly (replace placeholders with your actual info):

    git clone https://YOUR_BITBUCKET_USERNAME:YOUR_APP_PASSWORD@bitbucket.org/USER/REPO_NAME.git
    

For SSH Cloning

  • Generate or verify your SSH key pair
    First, check if you already have SSH keys in your user directory: navigate to C:\Users\YOUR_WINDOWS_USERNAME\.ssh and look for id_rsa (private key) and id_rsa.pub (public key). If they don’t exist, generate a new pair with:

    ssh-keygen -t rsa -b 4096 -C "your-email@example.com"
    

    Press Enter through all prompts to use the default settings.

  • Add your public key to Bitbucket
    Open Bitbucket, go to your personal settings → "SSH keys", then paste the entire content of id_rsa.pub into the text box and save it.

  • Test the SSH connection
    Verify the key works by running:

    ssh -T git@bitbucket.org
    

    If you see a message like logged in as YOUR_BITBUCKET_USERNAME, your SSH setup is good—now try cloning again.

Additional Checks

  • Folder permissions
    Even though you created the bitbucketstationslocations folder, double-check that your Windows user has read/write permissions for it. Right-click the folder → Properties → Security tab, and confirm your user account has the necessary access.
  • Repository access rights
    Make sure you’re actually added as a member of the Bitbucket repository (if it’s private) and have permission to clone it. Ask the repo owner to verify your access if needed.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.26 08:55:33