Push Error

I am trying to push commits from my local to remote repository and receive the below error.

git exited with code: 128
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'url.../production-app.git/'
 
How do I successfully push my changes to the remote repository?
Thanks.

Answers

  • Hi @LRho

    From the error message, this might be the credentials being the issue. I'd recommend having a look at this stackoverflow thread which covers this error message and steps that you can go through to try and resolve it:

    https://stackoverflow.com/questions/47860772/gitlab-remote-http-basic-access-denied-and-fatal-authentication

    Steps below if you can't access the link:
    1. Go to Windows Credential Manager. This is done in an EN-US Windows by pressing the Windows Key and typing 'credential'. In other localized Windows variants you need to use the localized term (See comments for some examples).

      alternatively you can use the shortcut control /name Microsoft.CredentialManager in the run dialog (WIN+R)

    2. Edit the git entry under Windows Credentials, replacing old password with the new one.

    Kind regards,

    Kurt McCormick
    Product Support Engineer, Redgate

    Need help? Take a look at our Help Center

  • LRhoLRho Posts: 4 New member
    I changed the passwords as recommended and received the following error.

    Unable to push. This may be because a reference that you are trying to update on the remote contains commits that are not present locally. Try to pull from the Get Latest tab and try again.
     ! [rejected]        dev -> dev (fetch first)
    error: failed to push some refs to 'https:url.../production-app.git'
    hint: Updates were rejected because the remote contains work that you do
    hint: not have locally. This is usually caused by another repository pushing
    hint: to the same ref. You may want to first integrate the remote changes
    hint: (e.g., 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.

    I tried to get latest changes and told there were no changes to pull.  Then, I tried pushing my existing changes to the remote repository and received another message.  Error message is git exited with code: 1
    [KWriting objects: 100% (34/34), 6.18 KiB | 421.00 KiB/s, done.
    Total 34 (delta 17), reused 0 (delta 0)
    remote: GitLab: You are not allowed to push code to protected branches on this project.
     ! [remote rejected] dev -> dev (pre-receive hook declined)
    error: failed to push some refs to 'https://url.../production-app.git'

    Any suggestions?
  • Hi @LRho

    Looks like the changing of the password got around the initial issue.

    As for this new one, you might want to try some of the options in the following thread:

    https://stackoverflow.com/questions/18328800/github-updates-were-rejected-because-the-remote-contains-work-that-you-do-not-h

    If that doesn't resolve it, then please try and un-link your source control and then re-link it. This can sometimes clear up the issue.

    For the "GitLab: You are not allowed to push code to protected branches on this project." error message, the below thread might also be of assistance.

    https://stackoverflow.com/questions/32246503/fix-gitlab-error-you-are-not-allowed-to-push-code-to-protected-branches-on-thi

    Kind regards,

    Kurt McCormick
    Product Support Engineer, Redgate

    Need help? Take a look at our Help Center

Sign In or Register to comment.