How do I push to GitHub under a different username?

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 her to push to her account. But it keeps trying to use my username and saying I don’t have access to her repository:

$ git push her_github_repository our_branch
ERROR: Permission to her_username/repository.git denied to my_username.
fatal: The remote end hung up unexpectedly

25 Answers
25

Leave a Comment