Reputation: 1667
I am trying to clone a project from gitlab to my local machine. I have been granted rights as a developer, and use the command 'git clone
The error message I am getting:
remote: The project you were looking for could not be found.
fatal: repository 'https://gitlab.com/KZA_Connected/skilltree.git/' not found
Any help would be highly appreciated.
Upvotes: 145
Views: 374947
Reputation: 4945
I solved 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
Upvotes: 212
Reputation: 79
1- Check the current remote URL
git remote -v
If it is incorrect, add the correct URL
git remote add origin [email protected]:<username>/<repository>.git
For example:
git remote add origin [email protected]:KZA_Connected/skilltree.git
2- If the problem is still not resolved, reset your email and username for the current repository directory
username
git config user.name "Your name Here"
git config user.email "[email protected]"
Upvotes: 1
Reputation: 691
Branch have only conditionally the right to reference commits in other gitlab projects.
We had to add an exception to reference commits from the particular other project.
Upvotes: 0
Reputation: 11
I resolved this problem by changing my role on gitlab, before my role was a developer and asked to owner change it to maintiner and this problem solved for me
Upvotes: 1
Reputation: 1454
If you are still facing the issue while cloning then try cloning with personal token
git clone https://<username>:<token>@gitlab.example.com/tanuki/awesome_project.git
For more refer this link.
Upvotes: 3
Reputation: 41
I was frustrated about this error
Following Steps solved the error(Run All this in terminal)
ssh -T [email protected]
Output -> Welcome to GitLab, @username!Now You Clone the project using
git clone https://[email protected]/organization_name/project_name.git
Upvotes: 3
Reputation: 807
I tried the above solutions but none work for me. But they helped me in understanding the problem. I had two Gitlab accounts on my new PC.
1 - Remove the Gitlab account in credential Manager Windows.
2 - No need to change the Url of the project.
3 - If you try to push now it will show another error and shows you a pop-up to sign into GitLab.
4 - If you were to sign up using a username/password. The problem will still persist. It will not work. The solution is to sign in through a Web Browser like chrome/edge. It will work. You will be able to push the project.
Upvotes: 0
Reputation: 13110
I got new account from my company gitlab so I added new ssh key but I got permission issue when tried to clone via ssh.
Then I tried ssh -T [email protected]
which returned Welcome to GitLab, @<my_old_account>!
I realized I have to remove old ssh keys from .ssh
folder. I removed them and it worked.
Upvotes: 1
Reputation: 455
On Intellij go to
Git->Manage Remotes
then select the url and edit your url to be https://{gitlab_user}@gitlab.com/gitlab_user/project_repo.git
Click Ok. On your password request. You can use your gitlab access token as password if you face authentication challenges.
Upvotes: 1
Reputation: 1
if your git --version > 2.10
run the following command in your project repo :
git config --add core.sshCommand "ssh -o IdentitiesOnly=yes -i ~/.ssh/path-to-your-key -F /dev/null"
Upvotes: 0
Reputation: 609
Put username before the url like this:
git clone https://[email protected]/projectname.git
To add git to an existing folder accordingly:
git remote add origin https://[email protected]/projectname.git
Upvotes: 7
Reputation: 191
If you (like me) have added multiple ssh keys, the solution is to explicitly state which key should be used for a remote host.
Add the following lines to the ~/.ssh/config file, depending on your use case:
Host bitbucket.org
User git
IdentityFile ~/.ssh/id_rsa
Host gitlab.com
User git
IdentityFile ~/.ssh/id_ed25519
Upvotes: 19
Reputation: 169
First of all verify your credentials are correct.
git config user.email
git config user.name
If they are correct, try appending your username@
before your repo address.
E.g. Instead of
git clone https://repo.abc.com/projectname.git
Try
git clone https://[email protected]/projectname.git
Upvotes: 13
Reputation: 6189
I have two gitlab accounts. For both I use ssh keys. Both are hosted by gitlab (not self-hosted).
When you run
ssh -T [email protected]
It will return your username.
Welcome to GitLab, @username1!
I was using ssh for @username1 and @username2. It defaults to the first ssh found. So, AFAIK, it's impossible to have two accounts with ssh.
My solution was to rm ssh key from the gitlab account I am not using.
Upvotes: 65
Reputation: 970
If you are facing the issue for a fresh repo
Just simply change the gitlab default https url from https://gitlab.com/rscodelab/project.git to https://[email protected]/rscodelab/project.git
for example
git clone https://gitlab.com/gitlabusername/project.git
to
git clone https://[email protected]/gitlabusername/project.git
Upvotes: 9
Reputation: 11
Upvotes: -2
Reputation: 119
If it's the first time after the git init command, Then use the below command
git remote add origin https://[email protected]/gitlabUsername/project_repo.git
Because git remote add origin https://gitlab.com/gitlabUsername/project_repo.git will not work, use the above instead.
If still you get the error, then Remove remote origin by the following and retry again by adding the origin using the correct command. to remove origin - git remote remove origin
Upvotes: 2
Reputation: 3723
There is credential manager on windows, which contains details about credentials of your host here is s.s of credential manager
then try this url formatter
https://{username}@gitlab.com/username/repo-name.git
in your case it will be like this
'https://[email protected]/KZA_Connected/skilltree.git/'
i was able to solve my problem deleting my credentials and adding them again i hope this help others too
-- Important note this credential manager save your global credentials, you can set your local credentials too using git config
git config --local user.name "Your name"
git config --local user.email "Your email"
git config --local credential.helper "store"
if you set credential.helper
to store, in current local git scope it will ask you password every time you do action like pull, push etc
if you want to reset credential.helper, then simply set it back to manager
it will work fine as before
Upvotes: 17
Reputation: 271
I solved the above problem
Before: https://gitlab.com/gitlab_user/myrepo.git
After: https://<gitlabusername>@gitlab.com/gitlab_user/myrepo.git
Explanation:
Type your gitlabUsername in place of <gitlabusername>
.
Now, it will ask for gitlab password for that your account. Enter the correct password and the project will be cloned successfully.
Upvotes: 22
Reputation: 406
In my case, I was not adding .git at the end of URL.
https://gitlab.com/{gitlab_user}/project_repo
corrected to
https://gitlab.com/{gitlab_user}/project_repo.git
This might seem like a silly mistake, but that was it!
Upvotes: 3
Reputation: 970
Simple Answer: Reset your already existing origin using the following command.
git remote set-url origin https://[email protected]/some-group/project.git
For you it's,
git remote set-url origin https://[email protected]/KZA_Connected/skilltree.git
git remote -v
(To check if the changes are reflected), then
git push origin master
Finished.
If it's the first time after the git init
Then
git remote add origin https://[email protected]/gitlabUsername/project_repo.git
Because git remote add origin https://gitlab.com/gitlabUsername/project_repo.git
will not work, use the above instead.
If still you get the error, then Remove remote origin by the following and add a new one again
git remote remove origin
Upvotes: 35
Reputation: 476
If adding the ssh key does not work, follow this -
eval "$(ssh-agent -s)"
Then add the ssh key
ssh-add ~/.ssh/<id_rsa>
Upvotes: 12
Reputation: 501
On mac osx, it usually means that your ssh credentials are not loaded. Brute force solution:
cd ~/.ssh
ssh-add *
I have to do this every time my Macbook reboots.
Upvotes: 37
Reputation: 4678
Today, I was having the same issue. The repo was working fine at my home machine, but when I tried the same repo in other machine I started facing the same error. I was using below URL
https://gitlab.com/{gitlab_user}/project_repo.git
And now I changed above URL to below
https://{gitlab_user}@gitlab.com/gitlab_user/project_repo.git
And it worked for me. Above solution was found at below URL
https://medium.com/@imstudio/gitlab-the-project-you-were-looking-for-could-not-be-found-issue-685944aa5485
Hope this helps other.
Upvotes: 66
Reputation: 1667
Solution: it was due my windows credentials being set to an other email account.
Upvotes: 4