D
D
Demigodd2018-03-15 15:52:42
git
Demigodd, 2018-03-15 15:52:42

How to remove Global name and mail?

Good afternoon, faced such problem. There are 2 Github accounts. In the PC, I already indicated the data of the 1st account git config --global user.name, mail . When I downloaded the repository of another account, and wanted to do git push origin master, I got an error.

$ git push origin master
remote: Permission to test/test1.git denied to Username.
fatal: unable to access 'https://github.com/test/test1/': The requested URL returned error: 403

Somewhere I read that you can create a local config, for other accounts,
git config --local user.name, mail But when sending push`a, the commits say that this commit was sent on behalf of the 1st user.
How to completely remove GLOBAL values ​​in git ? or is it correct to set local to a specific repository?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
AVKor, 2018-03-15
@Demigodd

~/.gitconfig

A
aol-nnov, 2018-03-15
@aol-nnov

these values ​​are only used when creating a commit.
if you first committed, and then went to change local parameters, it will not change anything.
the last commit can be git commit --amend --reset-author, the rest - through an interactive rebase.

A
Alexey Shumkin, 2018-03-15
@ashumkin

need to be done

echo -e "host=github.com\nprotocol=https" | git credential-manager erase

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question