Git user won't change on Mac

3785 views bash
1

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 user.name "myFriendsUsername"
git config --global user.email "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 user.name
git config --global user.email

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
'https://github.com/myUserName/myRepo.git/': 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

10

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

$ git config --global user.name "Full Name"
$ git config --global user.email "user@example.com"

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:

Screenshot

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

posted this
11

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?

JD

Please login first before posting an answer.