0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

git push時に「fatal: git-http-push failed」が出たとき

Posted at

エラー内容

サーバーからリポジトリをcloneし、ローカルで作業し、サーバーにpushしたところ、以下のようなエラーが出た。

$ git push origin test/branch
error: Cannot access URL http://11.2.33.444:8888/git/hoge/bar.git/, return code 22
fatal: git-http-push failed

解決法

リモートのoriginのURLに、「ユーザ名:パスワード@」を追加する。

$ git remote -v
origin  http://11.2.33.444:8888/git/hoge/bar.git (fetch)
origin  http://11.2.33.444:8888/git/hoge/bar.git (push)

$ git remote rm origin

$ git remote add origin http://username:password@11.2.33.444:8888/git/hoge/bar.git

$ git remote -v
origin  http://username:password@11.2.33.444:8888/git/hoge/bar.git (fetch)
origin  http://username:password@11.2.33.444:8888/git/hoge/bar.git (push)

以上の設定後、再びpushするとうまくいきました。

参考URL

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?