bier hier
bier hier

Reputation: 22530

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

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)

Upvotes: 4

Views: 33685

Answers (2)

Vrushali Raut
Vrushali Raut

Reputation: 1188

fatal: unable to access '': The requested URL returned error: 403 As you have developer access for pushing your code to particular project perhaps you are not able to push.. :( You need to add your identity first using

ssh-add ~/.ssh/id_rsa

and again try to push code to project
git push --set-upstream origin branch-name

Upvotes: 1

Christoph
Christoph

Reputation: 7063

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

Upvotes: 0

Related Questions