Multiple github accounts on the same computer?

后端 未结 25 2569
野的像风
野的像风 2020-11-22 02:56

Trying to work on my both my actual \"work\" repos, and my personal repos on git hub, from my computer.

The work account was set up first, and everything works flawl

25条回答
  •  日久生厌
    2020-11-22 03:31

    Use HTTPS:

    change remote url to https:

    git remote set-url origin https://USERNAME@github.com/USERNAME/PROJECTNAME.git
    

    and you are good to go:

    git push
    

    To ensure that the commits appear as performed by USERNAME, one can setup the user.name and user.email for this project, too:

    git config user.name USERNAME
    git config user.email USERNAME@example.com
    

提交回复
热议问题