Using Multiple GitHub Accounts: Automatically Select the Correct `gh` PAT Based on Repo Owner | vast-cow's blog
When using multiple GitHub accounts, the process of selecting the correct Personal Access Token (PAT)...
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (3)
For those who want to map owners and repository names, please refer to this.
What about repos in an organization?
Good question! For organization-owned repositories, you can add an explicit owner-to-account mapping with a
casestatement.For example, the helper could be extended like this:
So, for example:
For personal repositories that aren't explicitly mapped, the
*) account="$owner" ;;fallback preserves the original behavior.This is probably the simplest way to support organization-owned repositories while keeping the helper self-contained in
.gitconfig.