How do I push to GitHub under a different username?

后端 未结 20 2022
盖世英雄少女心
盖世英雄少女心 2020-12-02 04:00

A friend and myself are sharing my computer. I\'ve made pushes to GitHub using the git bash shell on Windows 7. Now we\'re in a different project on that computer and I need

20条回答
  •  鱼传尺愫
    2020-12-02 04:36

    if this is your problem

    remote: Permission to username1/repo.git denied to username2.
    fatal: unable to access 'https://github.com/username1/repo.git/':
    The requested URL returned error: 403
    

    In addition to changing username and email from terminal using git config:

    $ git config --global user.name "Bob"
    $ git config --global user.email "bob@example.com"
    

    you'll need to remove authorization info from Keychain. This solution took me several hours to figure out.I found that I also had certificate in my Keychain.

    Open up Keychain access, click on All Items and search for git. Delete all keychain

提交回复
热议问题