Skip to content

How to switch user aka. logout and sign in? #887

Description

@StefMa

Recently I had to create a new GitHub Account for my company because of legal reasons.
Before that I used this Account (and this cli tool) to navigate in our companies repository.
Now this Account don't have access to the repository anymore but my other account.
I also want to transfer the current "users" from the cli tool to my new GitHub user so that I have access to my companies repository again.
Unfortunately I don't see anything how can I do this. There is no option to "login" or "logout".
I also tried to uninstall and install the tool again - without success. It seems the config survives.. But I don't know where it is located :/

Anyways.
Question: How can I change my account (on macOS)?
Request: Please add a "login" and "logout" option to the CLI 🙃

Thank you 👍
Nice job with that tool. I really like it 🥇

Update

Okay, I just found this one

fmt.Fprintf(os.Stderr, " 2. Copy the contents of ~/.config/gh/config.yml to this system")

After I deleted this configuration file I could login again (with my new account).
But still, the request to "logout" is still valid I guess.

Activity

  1. mislav commented on May 8, 2020

    @mislav
    Contributor

    Sorry for the trouble! There was a request to support multiple user accounts #326. Even without supporting multiple accounts in parallel, I do believe that re-authenticating should be easier and more discoverable. For now deleting the config file is the way to go, but we hope to make it easier in future releases.

  2. harishvishwakarma commented on May 14, 2020

    @harishvishwakarma

    @mislav I would like to take this up to write the logout feature, if it isn’t very complex. This will be my first contribution.

  3. harishvishwakarma commented on May 14, 2020

    @harishvishwakarma

    Can then take this further to support multiple logins.

  4. StefMa commented on May 15, 2020

    @StefMa
    Author
  5. mislav commented on May 15, 2020

    @mislav
    Contributor

    @harishvishwakarma Thank you for your offer! Right now we haven't decided what the UI for login/logout should be, but when we do, we will update here if we wanted to open up for contributions.

    Ref. #297

  6. vilmibm commented on Aug 13, 2020

    @vilmibm
    Contributor

    Closing this as gh auth login and gh auth logout are now in trunk

  7. Jasonradford51 commented on Jan 27, 2025

    @Jasonradford51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions