I
git clone -v https://test.example.cc/Taotie/discover.git /Users/Macbook/go/src/test.example.cc/Taotie/discover
It fail.
git clone https://test.example.cc/Taotie/discover.git
Cloning into 'discover'...
fatal: '[email protected]/discover.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
but if I
git clone https://github.com/xormplus/xorm.git
it works.
I don't know why it miss a "/" int the git url .
and if I
git clone [email protected]:Taotie/discover.git
it works,because I have already add my mac rsa_pub into the gitlab and I can always git clone success with this format
git clone [email protected]:anything/project.
The reason I ask this question it that I use go get and it return error
bogon:Taotie Macbook$ go get test.example.cc/Taotie/discover
# cd .; git clone https://test.example.cc/Taotie/discover.git /Users/Macbook/go/src/test.example.cc/Taotie/discover
Cloning into '/Users/Macbook/go/src/test.example.cc/Taotie/discover'...
fatal: '[email protected]/discover.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
package test.example.cc/Taotie/discover: exit status 128
Finally git config --global url."[email protected]:".insteadOf "https://test.example.cc/"
solved my problem~~~
As @Oren_C said:
"fatal: '[email protected]/discover.git' does not appear to be a git repository" This is a syntax related to cloning with SSH.
You're cloning with SSH that being said and the repo exists, the only option left would be that you didn't add a SSH public key to your git instance.
You can copy it from ~/.ssh/id_rsa.pub
OP had used a wrongly url. The fix was to use:
[email protected]:Taotie/discover.git
Note the :
between host and repo instead of /
To clone the repo into your given directory use the following command:
git clone [email protected]:Taotie/discover.git /Users/Macbook/go/src/test.example.cc/Taotie/discover
This will clone the repo in the given directory: /Users/Macbook/go/src/test.example.cc/Taotie/discover
.
To clone it with Golang you should add a configuration:
git config --global url."[email protected]:".insteadOf "https://test.example.cc/"
This replaces the generated git url to be formatted correctly in the form of: [email protected]/name/repo.git
Then just run go get https://test.example.cc/Taotie/discover.git