0

I create a new project and trying to push on the new repository.

What I did is like this:

git init git remote add origin https://gitlab.com/test.dev/project1.git git add . git commit -m 'Initial commit' git push origin master 

and here's the error:

remote: The project you were looking for could not be found. fatal: repository 'https://gitlab.com/test.dev/project1.git/' not found 

I already try to remove and reapply still doesn't work.

3
  • 1
    Please confirm again that such a repo exists at that URL. Commented Apr 7, 2021 at 8:31
  • @iBug when I try to public it works but when I change to private the error appears Commented Apr 7, 2021 at 8:45
  • 1
    have you try to push via ssh rather than https (and set up ssh key beforehand)? Commented Apr 7, 2021 at 9:38

2 Answers 2

1

If None of the protocols (ssh and https) works and such a repo exists, then

Find the answer on this post.

Solve this by simply adding username to url like below,

Before: https://gitlab.com/gitlab_user/myrepo.git

After: https://[email protected]/gitlab_user/myrepo.git

Remember 'gitlabusername' is your gitlab user name and second gitlab_user would be project owner so the complete URL would be : https://[email protected]/repo_owner_gitlab_username/repo_name.git

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

Comments

0

in case your repository is private, you need to use ssh that would look like [email protected]:test.dev/project1.git
replacing your remote origin would help you
the command to do that would look like this:
git remote set-url origin [email protected]:test.dev/project1.git

1 Comment

in case your repository is private, you need to use ssh => I use private repos on gitlab.com over https without any problem. If there is a specific case linked to OP's question which forces him to use ssh, you should explain that in your answer. As far as I'm concerned, with the current available info, the repository just does not exist at all.