How to solve git: fatal : unable to access <some_repo>...?

Viewed 14736

When I try on gitlab :

  git push --set-upstream origin master

This is not a repo that I own, I just have access to gitlab. I suspect the repo owner has to give me access.

I get this error:

fatal: unable to access '<somegitrepo_ongitlab.git>': The requested URL returned error: 403

I tried changing the user and email like this:

git config user.name my_gitlabuser
git config user.email my_email

Still getting the same error.... How to solve this?

git remote -v results in:

 origin somegitrepo_ongitlab.git (fetch) 
 origin somegitrepo_ongitlab.git (push)

git remote show origin:

* remote origin
  Fetch URL: somegitrepo_ongitlab.git
  Push  URL: somegitrepo_ongitlab.git
  HEAD branch: master
  Remote branch:
    master new (next fetch will store in remotes/origin)
  Local ref configured for 'git push':
    master pushes to master (local out of date)
2 Answers

I think, you did not setup your remote correctly: it should look something like that:

.../test (master)
$ git remote show origin
* remote origin
  Fetch URL: https://github.com/Christoph999/test
  Push  URL: https://github.com/Christoph999/test
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)

Perhaps, this answer helps

Related