Good morning, my problem is that I want to upload changes to my remote repository but in Git Bash it does not allow me, throwing me the following error. With the GitHub Desktop application it allows me to push changes normally but in Git Bash it does not allow me.
I have already been investigating a bit and it seems that I changed the user because I opened the local repository with visual studio by automatically changing the user as shown in the image says Austin1400.
I already changed my user.name and user.email to how it was before, use -f to force the push obviously, but I couldn't fix this problem.
What I understand is that I have to change the account so that I have to authenticate my username and password as at the beginning, since I am only asked the first time I log in to git from then on, each push I do does not ask me authenticate me and upload the changes to my remote repository.
If someone knows how to enable a configuration to request authentication each time a push is made, I would appreciate it, or another option is to modify a file by placing the username and password, although I think that this option is not as valid since the account is, I suppose, validated with an internet connection to make queries that said user exists.
PROBLEM SOLVED
Inside the hidden folder of my local .git repository I opened the config file (which can be opened with a code editor or with the same git bash as the pros :D )
Where by default you will get something like this
Review some of the Git documentation regarding credentials in the following link https://git-scm.com/book/es/v2/Tools-of-Git-Storage-of-credentials
And finally check a video on youtube https://www.youtube.com/watch?v=LGw1lvcv75U&t=286s regarding multiple users in git and how to always request the key to the remote repository since by default in the latest versions no it is only possible to request the key for the first time to the remote connection with SSH if not also by HTTPS which does the same thing (Requesting the key only once after the push you make will not ask you for credentials to authenticate the account EMPHASIZING that already I ask you the first time).
We can see in the following image that by default request the credentials is in auto according to the GIT documentation
So we need to add or change this option whether you want to do it in --local or in --global or in --system to the .gitconfig file [credential] interactive = always
Staying as follows:
In my case I uninstalled git before doing this configuration, but it was not necessary I guess I hope this solution helps SUCCESS.
My solution add an SSH https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh
already added the SSH, change the URL
git remote set-url origin ssh://[email protected]/{name}/{repo}.git
GitHub Error: The requested URL returned error: 403 While pushing to a GitHub repository Hello, I followed the steps in this video and in my case from a Windows 10 PC, I deleted the credentials related to GitHub; then vscode asked me to authorize on github and it worked. I hope and help you.