1

I'm using Microsoft Git-Credential-Manager for Linux (Ubuntu) for a couple weeks, with some credentials, and now I need to push modifications to a different repo with different credentials. But I can't do this, because GCM is trying to use incorrect data to access this repository.

How do I change these or add new ones in order to be able to commit to different repos with different credentials? Is it possible?

1 Answer 1

1

You can use git credential manager command to delete the entry for a given remote host.

git credential-manager reject <url>

Once the entry is deleted, you would be able to store new credentials.

You can store (git credential-manager store) one credential per host and user: that will be valid for all repos owned by said user.

For a credential per repository, as seen in Git-Credential-Manager-for-Windows/issue 749, use (for Windows or Linux) the git config credential.useHttpPath, explained in git credentials.

 git config --global credential.useHttpPath true
Sign up to request clarification or add additional context in comments.

4 Comments

Thanks for your answer. So isn't there a way to store more than one credential, like one per repo? Basically, I'll need to remove the old credentials every time I need to push to a different repository?
@darksoulsong You can, with git credential-manager store, as seen in github.com/microsoft/Git-Credential-Manager-for-Windows/issues/… put one credential per host, and per user. Just make sure your remote URL to which you are pushing includes the username https::/[email protected]/username/myRepo.git
@darksoulsong It should: the idea is the API (store/reject/approve/...) remains the same for any implementation of a git credential-manager command.
@darksoulsong You can also have one credential per repo, as seen in my edited answer. But I would still recommend to stick with one credential per user and server hostname.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.