1

I was added to a GitLab project as a Maintainer. So when I first pushed to the empty repository, it was successful and was able to push the project to the repo. But when I made changes and tried to push it again, it sent the error access denied.

Then I made a new repo in GitLab and added some other project in it. In empty repo I was able to push, but after that I was not able to push to the repo.

Why is it that I can only push my commits in empty GitLab repository only.

Can anyone tell me why is this happening.

For reference : It was my first time using GitLab. The project manager asked me to make a GitLab account. Then I made one and added a SSH key. I am able to make a new branch in the project on the GitLab Website but not push changes with my local machine.

Thank you

2 Answers 2

1

The push rights should not change depending on the git repository state (empty or not empty)

Check if the issue persists by switching to the HTTPS URL of that same repository and trying to push:

cd /path/to/local/rpeository git remote set-url https://gitlab.com/<aGroup>/<aProject> git push -u origin master 

You might need to enter your GitLab username and password, but that will at least validate if the problem is limited or not to the SSH URL.

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

Comments

1

I got the solution.

Actually there was some problem in my ssh key. Maybe it was not set properly. when i checked with

ssh -T [email protected] 

I realized that. So I just made another ssh key and added it in the GitLab account. If anyone has similar problem or problem with pushing, this can be one of the reasons.

1 Comment

Good catch. What command did you use to regenerate your key?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.