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:

  • SourceTree how to reset on a already pushed commit
  • I need to checkout single folder from a Bitbucket Git repo
  • Proper way to release in Git with submodules
  • Can I make TortoiseGit remember by password? (using multiple BitBucket accounts)
  • Git: Why cloning MUST be done in a non-existing/empty directory?
  • How to preserve history on bitbucket while moving files within a repository
  • 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! 🙂

  • Why can't I clone any repository in Git?
  • Can the git tree hash be used to uniquely identify a specific state in a subdirectory
  • State of identical files being both added and removed
  • how to completely replace code in a git repository
  • git reset --merge vs git reset --keep
  • git rerere does not auto-commit autoupdated merge resolutions
  • 2 Solutions collect form web for “Change git account in specific project”

    You need to add your ~/.ssh/id_rsa.pub in your GitLab account.

    Go to GitHub Profile | SSH Keys | Add SSH Key using browser. Then add a new SSH key with ~/.ssh/id_rsa.pub.

    Create and Add SSH key


    Alternate, Change your clone URL from SSH to https. Then clone the repo with your GitLab username/password.

    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.

    Git Baby is a git and github fan, let's start git clone.