xhulio
xhulio

Reputation: 1103

Gitlab push does not work, pull works perfectly

I have a server where I have installed gitlab and have created a project. I modified the post-receive hook where I declared the working tree and the git repo. After that I cloned my project to my local machine and everything went perfectly. When I tried to push I got the following error.

git.exe push --progress "origin" master:master

Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (10/10), 1.35 KiB | 0 bytes/s, done.
Total 10 (delta 3), reused 0 (delta 0)
remote: GitLab: The project you were looking for could not be found.
To ssh://server/path/repo.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@server/path/repo.git'


git did not exit cleanly (exit code 1) (6240 ms @ 11/23/2016 2:35:10 PM)

It says that the project could not be found but I was able to pull it. Gitlab and the repo are on the same server.

If anyone has any fix, it would be greatly appreciated.

Upvotes: 2

Views: 10986

Answers (3)

Asanka Siriwardena
Asanka Siriwardena

Reputation: 991

For this I had to create a personal access token https://gitlab.com/profile/personal_access_tokens

Once you have a token, you can enter it instead of your password when performing Git operations over HTTPS.

For example: enter image description here

Upvotes: 2

Milan Krushna
Milan Krushna

Reputation: 315

Change Permission for your repository

Go to setting->Permissions

Click on Expand

Then change Project visibility to

Internal or Public

Upvotes: 1

vgonisanz
vgonisanz

Reputation: 11930

It seems you have a bad remote address. You can check your remote address using

git remote show origin

It must appear something like:

Push  URL: git@<address>:<project>/<repository_name>.git

If you have a bad address, starting with ssh:// or something like that, try changing remote address:

git remote set-url origin git://new.url.here

Proper address will appear in Gitlab project page. You can find more info using git help remote

Upvotes: 2

Related Questions