osx - How can I change Git username when I want to pull or push repo? -


the default account used pull or push on git not account. every time git push, automatically uses default account this. searched lot , changed username , email in ~/.gitconfig. it's still not woking, when try push or pull, it's still not asking me input password , work using default account not mine.

i'm confused this. how can fix this?

on mac os x (as indicated in question), username/password accessing git repos using http(s) stored in keychain access application.

to remove stored username entries, open keychain access application, select login keychain in top left. in bottom left part of window, select passwords. next, type name of git server in top right search box.

once stored entries shown, select ones you're interested in. double-clicking them open them show details stored username , url. can show password screen.

when have found entries use wrong username, can delete them. on next push/pull, git should ask username/password, long username not part of remote's url.

keychain access


Comments