Thanks for reviewing my question. i'm facing issue with my git push. i have 2 github accounts, i'm accessing the 2nd account through git bash but when i'm trying to push the code in to github it is denied the request due to push request going from other account user name.. i updated the global username,email and Credential username but still i'm getting the same 403 response. please help me to resolve this issue.
-
1Try opening your .gitconfig manually and replacing all occurrences of the other account with the one you want – entropy Mar 16 '19 at 08:54
-
can you please explain how can i do that.. i'm new to git – Satish Rongala Mar 16 '19 at 08:56
-
i opened the gitconfig file and i able to see my new details only – Satish Rongala Mar 16 '19 at 09:19
-
1GitHub looks at your ssh key to identify you. – Thorbjørn Ravn Andersen Mar 16 '19 at 09:56
-
so what i have to do for that – Satish Rongala Mar 16 '19 at 09:58
2 Answers
Execute
git config --list
to check current username & email in your local repository.Change your username & email as desired. Set it globally or specific to the local repository:
git config [--global] user.name "Username"
git config [--global] user.email "Email@Adress.com"
You could also edit .git/config manually instead to your desired username.
Alternatively, if you push over https protocol, Github will prompt for username/password each time you push.
You can just switch to https, rather than ssh. If you use https, it will respect the .git/config settings. So, in .git/config, change:
url = git@github.com:USER/PROJECT.git
to
url = https://USER@github.com/USER/PROJECT.git
or via terminal
git remote set-url origin "Remoteurl"
Github identifies you by the ssh key.
Use
ssh-add -l
to determine which keys you are using, andssh-add -d <keyfile>
to remove a specific key, if it dosent work remove the 'unwanted' ssh key from ~/.ssh/config

- 1,925
- 1
- 13
- 21
-
i dont know whether i'm seeing the correct file or not but i'm able to see only username and email..other than that there is nothing to edit – Satish Rongala Mar 16 '19 at 12:42
i deleted my credentials stored in the windows credentials manager.. and it resolved my problem

- 209
- 6
- 19