![]() ![]() The following flows explain how Git HTTPS authentication works with and without the GCM. All future Git commands will reuse the existing credentials. It securely stores your credentials in the Windows Credential Manager so you only need to enter them once for each remote repo you access. That will let you quickly do one-time operations as the other account without needing to log out / in, mess up your other git credentials, etc.The Git Credential Manager for Windows (GCM) is a credential helper for Git. Set the value of the credential manager back to what it was, e.g manager-core in my case: git config -system credential.helper manager-core.Use the shared account username, and the personal access token as the password.Unset the credential manager, which will prompt you for PW going forward: git config -system -unset credential.helper.Note this value for later you will need it to set things back. Check the value of credential manager: git config -system credential.helper.I’m doing the steps here manually but it could almost certainly be automated in a tiny script. Unset the git credential manager temporarily Add the remote if it’s not already added: git remote add REMOTE_NAME THE_URL_OF_THE_REMOTE. ![]() This access token is as good as a password, so I treat it with the respect it deserves. If you’re unfamiliar with this, you can follow the steps in the GitHub docs. Since I had the credentials, I did this via a normal browser session (in a private window since I was just logging in once.) (Have a better way? I’d love to hear about it in the comments!) Generate an Access Token for the Shared Account I found a reasonable way to do this, and I’ll run through the steps below. So when I occasionally needed to use this remote, I would have to log out and log in as the service account. The only issue is that only a shared GitHub account had access, not my own account (due to a vendor limitation). ![]() How to Force git to Prompt You For a PasswordĪ fun git challenge! I had to make a request against a remote repository in git. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |