Cannot push to Git repository on Bitbucket

后端 未结 21 751
春和景丽
春和景丽 2020-11-29 14:40

I created a new repository and I\'m running into a strange error. I\'ve used Git before on Bitbucket but I just reformatted and now I can\'t seem to get Git to work. After

21条回答
  •  北荒
    北荒 (楼主)
    2020-11-29 15:41

    I am using macOS and although i had setup my public key in bitbucket the next time i tried to push i got

    repository access denied.

    fatal: Could not read from remote repository.

    Please make sure you have the correct access rights and the repository exists.

    What i had to do was Step 2. Add the key to the ssh-agent as described in Bitbucket SSH keys setup guide and especially the 3rd step:

    (macOS only) So that your computer remembers your password each time it restarts, open (or create) the ~/.ssh/config file and add these lines to the file:

    Host *
    UseKeychain yes

    Hope it helps a mac user with the same issue.

提交回复
热议问题