Change Github account in Android Studio

后端 未结 11 577
我在风中等你
我在风中等你 2021-02-05 02:37

I have used one Github account to push an android project to Github from Android Studio. Now I have created another account on Github and want to push my another android project

相关标签:
11条回答
  • 2021-02-05 03:10

    I was also facing the same issue (working on same PC with diff usernames)

    remote: Permission to new_username/repository_name.git denied to old_username.

    Tried all solution mentioned even deleting .gitconfig didn't work.

    In the end, solved by following different way :
    1. Adding as Collaborator to old_username
    2. Accept collaboration invitation (Make sure you are logged in to old_username)
    3. Push with new_username. Done!

    0 讨论(0)
  • 2021-02-05 03:11

    When prompted for a username and password, make sure you use an account that has access to the repository.

    And in the image of Nir Duan, you must click to the button "test" to verify your connection.

    0 讨论(0)
  • 2021-02-05 03:13

    You need to first go to: Setting --> Version Control --> GitHub --> Change you username. (just like Nir Duan) said.

    Then go to: VCS --> Checkout of Version Control --> Github

    Log in with new credentials if asked, Change the Git URL and possibly parent directory, Click on clone, open in another window, wait for it to load. close the new window.

    Next time you want to push you will see the new repository as part of the options at the top left on the "Push commit" pop-up

    0 讨论(0)
  • 2021-02-05 03:16

    I had the same problem, all you need to do is open your shell and type--

    $git config --global user.name [your username]
    $git config --global user.email [your email]

    since you probably logged in with git using a different account

    0 讨论(0)
  • 2021-02-05 03:19

    Uncheck the Use Credentials Helper from Settings -> Version Control -> Git. Then log in using the desired account and select the account you want to continue with from Settings -> Version Control -> GitHub.

    0 讨论(0)
提交回复
热议问题