22

私の macbook pro は、会社の git サーバーからクローン/プッシュ/プルできます。私のcent 6.3 vmは401エラーを受け取ります

git clone https://git.acme.com/git/torque-setup
"error: The requested URL returned error: 401 Authorization Required while accessing https://git.acme.com/git/torque-setup/info/refs

As a work around, I've tried creating a folder, with an empty repository, then setting the remote to the company server. I get the same error when trying a git pull

The remotes are identical between the machines

MacBook Pro (working)

git --version
git version 1.7.10.2 (Apple Git-33)

git remote -v
origin  https://git.acme.com/git/torque-setup (fetch)
origin  https://git.acme.com/git/torque-setup (push)

Cent 6.3 (not working)

yum install -y git

git --version
git version 1.7.1

git remote -v
origin  https://git.acme.com/git/torque-setup (fetch)
origin  https://git.acme.com/git/torque-setup (push)


The git server only allows https. Not git or ssh connections.

Why is the macbook pro able to do a git pull, while the cent os machine can't?


Solution Update 2013-5-15

As jku mentioned, the culprit is the old version of git installed on the cent box. Unfortunately, 1.7.1 is what you get when you run yum install git

The work around is to manually install a newer version of git, or simply add the username to the repo

git clone https://joe@git.acme.com/git/torque-setup
4

2 に答える 2

20

git バージョンを更新します。1.7.10 (またはそのあたり) では認証が改善されました。これらの改善はプロキシにのみ関連している可能性がありますが、詳細は忘れてしまいました。

プロキシについて言えば、git config を再確認できます。Macbook ではプロキシなどを構成していませんが、cent マシンでは構成していませんか?

于 2013-05-15T18:58:47.897 に答える
-4

私は同じエラーがありました:

error: The requested URL returned error: 401 while accessing 
fatal: HTTP request failed

それを修正するために、次のことを行いました。

check git version: 1.7.1
update git
于 2016-06-27T11:26:54.487 に答える