1

I have created a gitlab repo and cloned on my local machine. I made some changes by login to gitlab and fetched into my local and it works fine. But, I cannot push any changes made locally to gitlab project. I have added the public sshkey into my gitlab account for ssh access.

Push using https works fine as well.

This is the error when I try to push to gitlab project using ssh method.

GitLab: You don't have permission fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Please advise what could be wrong.

2 Answers 2

1

All seems fine. But can you give use the result of the following command:

 git remote -v 

Moreover if the ssh key your trying to use is not id_rsa you may have some other problems.

(I would have leave this as a comment but I have not the 50 points needed)

Sign up to request clarification or add additional context in comments.

5 Comments

git remote -v origin[email protected]:user/project.git (fetch) origin[email protected]:user/project.git (push)
nothing abnormal here. Are you using the id_rsa ssh key ?
what is the command you use to push to the remote repository ? git push origin master ?
The problem may come from gitlab, you may not have the right permission in it.
probably something wrong. could not figure it out. but deleted everything on gitlab and re-created. its all working fine . thanks for help
0

Old question, but may be relevant for someone looking for the some issue now.

I had some issues with Gitlab permissions. Even with Admin privileges in the Gitlab, SSH correctly configured and all working as supposed but could not push. Some things you may check:

  • Branch is not protected in the Project Settings
  • Added as member in the project explicitly
  • Have not been banned after a lot of auth retried by security measures such as fail2ban. Can make you lose good hours if using hosted Gitlab in AWS until you figure it out.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.