remote: The project you were looking for could not be found.

Problem Description

Because different accounts were used to log in to different projects, this problem was reported when we changed back to the original account to download the code on git. The cause of this problem is actually caused by our constant replacement of login accounts.
git command to change users: git config --global user.name “zhangsan”
git config --global user.email “[email protected]
Attach a screenshot of this error:

Insert picture description here

Solution one

We can directly use the account password to download the code on git. For example, normally we clone a code like this git clone -b master http://172.168.1.1/abc/abc.git, we can directly specify the user when downloading Password to download the corresponding code, so that this problem will not occur. So how to add the user name and password, as shown below:

 //不适用用户密码直接下载
 git clone -b master http://172.16.1.11:0000/bmp/tmp.git
 //制定个用户密码进行下载
git clone -b master http://用户名:密码@172.16.1.11:0000/bmp/tmp.git

Note: If the user name or password contains the @ character, use a special escape, and use %40 to replace the @ character. , And the @ followed by the password is the separator used to distinguish the username and password from the git address.
I personally tested this method and it works.

Solution two

This way is to solve this problem from the root cause. First of all, we must clarify what the root cause of this problem is. This problem is caused by switching different users to log in to git, so that the computer will save the previous login information in the credentials. , Which led to this problem when we downloaded the code. The following figure shows the information saved in the credentials.
Insert picture description here
Where can I find this information? Just click the windows button and enter the credentials to see it.
Insert picture description here
We know that directly deleting the credential information that affects you can solve the problem. If you don’t know which affected you, just delete all the credential information about git directly. When you download the code from scratch, git will prompt you to enter the user. Name and password, so you can download normally. It solves this problem. I have personally tested this method and it is effective.

Solution three

Delete your git and download again. When you delete git, the credential information will also become invalid. After the download is completed, log in again to solve it. This is an unclear solution, but it can also achieve the goal. It is recommended to use method one and method two.

to sum up

This problem occurs because we use different accounts to log in to git. Therefore, it is recommended that we use git to log in with only one account, that is, only use our own most commonly used account. When downloading other project codes, we need to use other people's git accounts. , It is recommended not to log in to other people’s accounts. We can download these codes by specifying the user’s password, just like the one above, so that this problem can be avoided.

Guess you like

Origin blog.csdn.net/m0_46897923/article/details/114982796