0

i have a repository on bitbucket and i cloned it to my laptop as "Repo1" and there it is where i commit and push. From an instance of DigitalOcean i make pull requests. But, i cloned again the repository from bitbucket to my laptop as "Repo2" and i dit lot of changes and continue working normally.

Now i need to push a commit and GitKraken says "error authenticating. failed connecting with agent"

If i push the commit with the shell "git push origin master" appears "Unauthorized. fatal: can't read remote repository"

How can i do to push from the second repository?

I have already set user.name and user.email and remote addedd

Please help :-(

phd
  • 82,685
  • 13
  • 120
  • 165
German
  • 192
  • 1
  • 11
  • What is the output from `git remote -v` in "Repo2"? (Note that `user.name` and `user.email` are only used to set metadata on commits. They are **not** used for authentication.) – Code-Apprentice Mar 13 '20 at 19:41
  • Does this answer your question? [git: fatal: Could not read from remote repository](https://stackoverflow.com/questions/13509293/git-fatal-could-not-read-from-remote-repository) – Code-Apprentice Mar 13 '20 at 19:43
  • the git remove -v is the url of the bitbucket git repository and is the same of Repo1. I still need solution – German Mar 13 '20 at 19:55
  • Please show the output rather than summarizing. Feel free to replace sensitive information with placeholders. – Code-Apprentice Mar 13 '20 at 19:57

1 Answers1

0

You have two ways to clone your repo, either by ssh or by https protocols. You are likely using ssh. (ie. you cloned your repo with

git clone ssh://git@bitbucket.com:{username}/{repo_name}.git

).

In the computer you are having the problem, the ssh private key is missing or the public one is not the same as the one registered in bitbucket.

To move ahead with this problem, you can add the repo with https protocol (in your laptop where Repo2 is located) using

git remote add origin https://{username}@bitbucket.org/{username}/{repo}.git

and then do your push as usual. It should work :)

Pablo Burgos
  • 1,194
  • 1
  • 10
  • 21