Git clone with https failed, but with http succeed.
Created by: eric-nuaa
I am trying to clone a project on a GitLab which is hosted by someone else, but I found https failed:
$ git clone https://git.xxx.com/eric/testproj.git
Initialized empty Git repository in /home/eric/testproj/.git/
error: while accessing https://git.xxx.com/eric/testproj.git/info/refs
fatal: HTTP request failed
But git clone with http succeed:
$ git clone http://git.xxx.com/eric/testproj.git
Initialized empty Git repository in /home/egobuild/testproj/.git/
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 9 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (9/9), done.
The version of the GitLab is: 7.5.3.
And after git clone with http, I changed some code for the project, and tried to push to remote master, but failed, it even did not ask for my username/password for the GitLab.
$ git push
error: The requested URL returned error: 401 Unauthorized while accessing http://git.xxx.com/eric/testproj.git/info/refs
fatal: HTTP request failed
The weird thing is, I have another machine on which I can clone this project with https (this machine is in a different network from the machine above), so I scp the project with the changed code to this machine, and then "git push" succeed (it asked for my username/password for the GitLab)! I am not sure what the root cause is, network issue?
Any help will be really appreciated, thanks!