git - how to log out of one Github account and use another account? -


i using github account practice, , set own github account. using own account on. problem computer still logged in github account name (even though logged own github account online).

i cannot push own github repos, because other account not have permission that, obviously. how tell computer switch on own account can push repos in github online?

if using osx, open terminal , run this:

git credential-osxkeychain erase host=github.com protocol=https 

to erase keychain entry. next time prompt login.

to view current credentials cached use command git credential-osxkeychain get followed pressing enter twice.

if press enter once invoke command apear hang, if press enter second time prompted dialog box confirm access keychain , information returned in terminal


if prevent issue in future can configure git helper tool osx-keychain store login credentials associated entire path of repository rather domain default.

in terminal enter command

git config --global --edit 

this open configuration file. if haven't already, may want set default editor file opens in preferred application.. example, set sublime text default editor: git config --global core.editor "subl -n -w"

with config file opened, search usehttppath (or define if doesn't exist). , set it's value true. should this:

[credential]   helper = osxkeychain   usehttppath = true 

this instruct git (as github) credentials used login should associated full repository path queried, not entire domain (in case of github) repositories on github.com.. so can logged repository, , boyfriend can logged repository , there no conflicts between logins.


Comments