Git push The requested URL returned error: 403

2

Good morning, my problem is that I want to upload changes to my remote repository but in Git Bash it does not allow me to launch the following error. With the GitHub Desktop application it allows me to upload changes in a normal way but in the Git Bash it does not allow me.

I've been doing a bit of research and it seems that I changed users because I opened the local repository with a visual studio, making an automatic user change as shown in the image, says Austin1400.

I already changed my user.name and user.email as I was before, I used -f to force the push obviously, but I could not fix this problem.

What I understand is that I have to change my account so I have to authenticate my username and password as at the beginning, since I was only asked the first time I logged in every step of the way. it does not ask me to authenticate and upload the changes to my remote repository.

If someone knows how to enable some configuration to request authentication every time you push, I would appreciate it, or another option is to modify some file by placing the username and password although I think this option is not as valid as the account I guess that is validated with a connection to the internet to make inquiries about the presence of said user.

    
asked by Roberto E. M. Austin 03.10.2018 в 08:41
source

1 answer

1

Problem RESOLVED

Inside the hidden folder of my local repository .git 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'll get something like that

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
[remote "origin"]
    url = https://github.com/theLastPixel/Home-sales-web.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "pageNosotros"]
    remote = origin
    merge = refs/heads/pageNosotros
[credential]
    helper = manager

Review a bit of the Git documentation regarding credentials at the following link link

And finally review a video on YouTube link regarding multiple users on git and how always request the key to the remote repository since by default in the latest versions it is not only possible to request the key for the first time to the remote connection with SSH but also for HTTPS which does the same thing (Request only once the password later the push you make will not ask for credentials to authenticate the account RECALLING that I already requested it the first time).

we can see in the following image that by default the credentials are requested by auto according to the GIT documentation

So we must add or change this option whether you want to do it in --local or --global or --system to the file .gitconfig [credential]     interactive = always

Staying as follows:

[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
[remote "origin"]
    url = https://github.com/theLastPixel/Home-sales-web.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "pageNosotros"]
    remote = origin
    merge = refs/heads/pageNosotros
[credential]
    interactive = always

In my case I uninstalled git before making this configuration, but it was not necessary I suppose I hope this solution will help SUCCESS.

    
answered by 03.10.2018 в 23:42