0

I receive the following error whilst trying to push to my newly created repo hosted using gogs on my server:

$ git push origin master
remote: User permission denied
fatal: unable to access 'https://myserver.co.uk/gogs/jacque/myRepo.git/': The requested URL returned error: 403

I can access gogs just fine in my browser, I can clone repositories with no issue, I just can't push to my remote.

I know this question has been asked on multiple occasions but I can't seem to get anywhere trying any of the other answers.

For extra information, I'm using git for windows on windows 10. My server is running raspbian.

Edit: If the repo is initialised using VS it works fine but this doesn't solve my problem.

ScottishTapWater
  • 3,656
  • 4
  • 38
  • 81

3 Answers3

3

I have some solutions for that problem. Let's see:

1. Windows Credential Manager

If there is a problem about your credentials, check Credential Manager, and refresh your credentials.

2. Gogs Teams

I have a special team called Owners. This team has full access to all repositories and has admin rights to the organization. You can add your users to that team. To do that you must be admin. That's why when installation the Gogs, you need to define your admin account.

3. Admin Rights

If you have admin account you can give admin rights using Admin Panel -> Users -> Select user name and click the edit button -> Click This account has administrator permissions & This account has permissions to create Git hooks

4. Accessibility of Repository

Be sure your repository Visibility is not Private. Check that property on your repo's Settings page.

5. Collabration rights

Add a collaborator

Go to Repository Settings -> Collaboration, and type the username you want to add a collaborator:

ClickToSeeImage

Then hit Add New Collaborator.

Change collaboration’s access mode

Collaborators gain Admin access mode by default, you can change their access mode as follows:

ClickToSeeImage

0

It maybe too late but I note here about similar issue and solving.

I have full rights for push and pull to the gogs repo. But I have issue for some few repo branches.

$ git push
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 747.35 KiB | 26.69 MiB/s, done.
Total 5 (delta 1), reused 0 (delta 0)
error: RPC failed; HTTP 403 curl 22 The reqfuested URL returned error: 403 Forbidden
atal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

I thought after a long time the problem is with a pushed content and started to pushed branch content file by file. I found in my case it couldn't push pptx 700 KB file and I have any restrictions to file size in my gogs config.

-1

Based on the error message, you have pull access but no push access to the repository.

Joe Chen
  • 100
  • 7