Change git account in specific project
My BitBucket account is globally installed for my git projects.
Now I have to use my Gitlab account from school for a project. When I try to clone the repository I get the error:
Cloning into '*****'... Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the co
I think that it is because I try to clone with my BitBucket account which is not connected to this Gitlab repository.
Does someone know how I can change my config for only this project?
Thanks for the help! 🙂
2 Solutions collect form web for “Change git account in specific project”
You need to add your
~/.ssh/id_rsa.pub in your
GitHub Profile |
SSH Keys |
Add SSH Key using browser. Then add a new SSH key with
Create and Add SSH key
Alternate, Change your clone URL from
https. Then clone the repo with your
The solution would be to add your ssh key as @sajib khan suggested.
If you do not want to add your ssh key to gitlab, you can look and see if gitlab allows you to connect via http(s). If so then you can clone the repo with the http(s) link. If that is the case, then gitlab may ask you to login on occasion.