0

I'm trying to clone code from the git server. I'm using windows 7, 32bit computer. I installed msysgit and TortoiseGit.

But whenever I tried the clone command, I'm getting the following error:

git.exe clone   --progress -v  "http://vcs.hiit.fi/git/hiit_wfa" "C:\Users\athukora\Desktop\HIIT wide focus area\hiit_wfa"

Cloning into 'C:\Users\athukora\Desktop\HIIT wide focus area\hiit_wfa'...
error: The requested URL returned error: 401 (curl_result = 22, http_code = 401, sha1 = 9b1b551b5e4b7c7666df38c129d1ecc480c77347)
error: Unable to find 9b1b551b5e4b7c7666df38c129d1ecc480c77347 under http://vcs.hiit.fi/git/hiit_wfa
Cannot obtain needed object 9b1b551b5e4b7c7666df38c129d1ecc480c77347
while processing commit 876cb1098d91238e87c239b8151eeba5330f4480.
error: Fetch failed.

Can someone please help me to figure out the reason for this problem?

Yue Lin Ho
  • 2,945
  • 26
  • 36
Paba
  • 1,105
  • 3
  • 19
  • 34

2 Answers2

1

You're cloning a repository via HTTP protocol, and the server needs authentication (401 error is "Authentication required".

Provided you have credentials for the repoistory, you need to provide user name in URL:

git.exe clone   --progress -v  "http://usernname@vcs.hiit.fi/git/hiit_wfa" "<path>"

Git will then prompt you for password.

See this post for other ways to provide your credentials.

Community
  • 1
  • 1
CharlesB
  • 86,532
  • 28
  • 194
  • 218
  • Thank you. This is the command that worked for me https://username:password@vcs.hiit.fi/git/hiit_wfa destination_folder – Paba Jan 19 '12 at 11:35
  • 1
    it's preferable to not put `:password` there, as now your password is saved in your shell history – M.M Mar 12 '16 at 12:27
0

If someone comes across the same problem in future please refer to this http://kumaripaba.blogspot.com/2012/01/how-to-use-git-in-windows.html

I made a detailed description of the problem I had and the solution.

Paba
  • 1,105
  • 3
  • 19
  • 34