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.

flaxel
  • 4,173
  • 4
  • 17
  • 30

2 Answers2

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://gitlabusername@gitlab.com/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://your_gitlab_username@gitlab.com/repo_owner_gitlab_username/repo_name.git

Rakhi Agrawal
  • 827
  • 7
  • 14
0

in case your repository is private, you need to use ssh that would look like git@gitlab.com: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 git@gitlab.com:test.dev/project1.git

jak1
  • 3
  • 3
  • `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. – Zeitounator Apr 07 '21 at 12:20