Git user won't change on Mac

3785 views bash

Last week a friend of mine cloned her Github repository and did some work on it on my machine. She changed the user config on my machine using the following bash commands:

git config --global "myFriendsUsername"
git config --global "myFriendsEmail"

When she was done, she used the same commands to change the user config back to my credentials and I verified this using

git config --global
git config --global

which returned my credentials. However, today I cloned a repository of my own, committed some changes and tried to push to origin but it gave me the following error:

remote: Permission to myUsername/myRepo.git denied to myFriendsUsername.
fatal: unable to access
'': The requested URL returned error: 403

Are there any settings that I'm possibly neglecting?

answered question

What is your code for test it?

2 Answers


The git config settings you changed are used when committing changes to a repository, not for authorization:

$ git config --global "Full Name"
$ git config --global ""

When your friend cloned a git repository, its likely that your computer's credentials manager (Keychain on Mac OS) saved the authorization certificate.

To remove this authorization certificate, open up Keychain, click on All Items and search for git. You will get some items like this:


After deleting these certificates, Git should prompt you to reauthorize on your next action.

posted this

Use Index.duplicated:

idx = df.index[df.index.duplicated(keep=False)]

Solution with groupby is possible, but I think slowier - only necessary pass any column name and get counts per groups by GroupBy.transform with GroupBy.size:

idx = df.index[df.groupby(level=0, sort=False)['col'].transform('size') > 1]

posted this

Have an answer?


Please login first before posting an answer.