LoginSignup
4
3

More than 3 years have passed since last update.

gitはsshでクローンしろ(自戒)

Last updated at Posted at 2020-04-02

何が起きたの

これまでgitクローンする方法は特に意識してなかったんですが、今回httpでクローンしたところ、cloneもpullもできるのにpushだけエラーが出るという事が起こりました。

httpでクローン

$ git clone http://[ドメイン]/hoge.git

ファイルを編集し...よし!pushだ!

$ git push origin develop
warning: redirecting to https://[ドメイン]/hoge.git/
(中略)
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
Everything up-to-date

なんでやねん

error: RPC failed; curl 18 transfer closed with outstanding read data remaining

というエラーでぐぐると、どうもpushするときのサイズが小さすぎるのでサイズ増やせば解決するとのことでしたが、変わらずエラーが出てしまいます。

解決

こちらなどを参考にssh設定し、以下コマンドでクローン

$ git clone git@[ドメイン]:hoge.git

改めてファイルを再編集し、さきほどと同じpushコマンドを実行すると無事成功!やった〜!

今回の解決法はこちらを参考にしました。
https://stackoverflow.com/questions/38618885/error-rpc-failed-curl-transfer-closed-with-outstanding-read-data-remaining

そういえば今回の事象以外でもSSHでクローンしないことで、他のgitコマンドを実行したときに問題になったような...。いろいろ検証不足で恐縮ですが「クローンの方法によって後々問題が発生する」ことを忘れないように自戒も込めて記事にしました。m(_ _)m

4
3
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
4
3