XSERVER+gitでエラー(cURL関連)

「git pull」でエラーになる

作成日:2020-08-17, 更新日:2020-08-17

経緯

gitをいれてから「git pull」をするとエラーがでてきた

warning: Pulling without specifying how to reconcile divergent branches is discouraged. You can squelch this message by running one of the following commands sometime before your next pull:

  git config pull.rebase false  # merge (the default strategy)
  git config pull.rebase true   # rebase
  git config pull.ff only       # fast-forward only

You can replace "git config" with "git config --global" to set a default preference for all repositories. You can also pass --rebase, --no-rebase, or --ff-only on the command line to override the configured default per invocation.

fatal: unable to find remote helper for 'https'

・git config
・https
の2つに問題があるっぽい

エラー:git config

warning: Pulling without specifying how to reconcile divergent branches is discouraged. You can squelch this message by running one of the following commands sometime before your next pull:

  git config pull.rebase false  # merge (the default strategy)
  git config pull.rebase true   # rebase
  git config pull.ff only       # fast-forward only

You can replace "git config" with "git config --global" to set a default preference for all repositories. You can also pass --rebase, --no-rebase, or --ff-only on the command line to override the configured default per invocation.

▼日本語にするとこんな感じっぽい

警告:分岐ブランチの調整方法を指定せずにプルすることはお勧めしません。
次のプルの前に、次のいずれかのコマンドを実行することで、このメッセージを抑制できます。

  git config pull.rebase false  # merge (the default strategy)
  git config pull.rebase true   # rebase
  git config pull.ff only       # fast-forward only

「git config」を「git config --global」に置き換えて、すべてのリポジトリのデフォルト設定を設定できます。
コマンドラインで--rebase、-no-rebase、または--ff-onlyを渡して、呼び出しごとに構成されたデフォルトを上書きすることもできます。

よくわからんが・・・ひとまず「git config pull.ff only」を実行。
その後「git pull」をするがhttpsのほうのエラーは消えてくれない。

エラー:https

fatal: unable to find remote helper for 'https'

▼日本語にするとこんな感じっぽい

致命的:「https」のリモートヘルパーが見つかりません

対策

・curl-devel パッケージが別途必要(XSERVERは「curlはある」「curl-devel パッケージは無い」)
・パッケージのインストールができない(yumとかが使えない)

XSERVER+bitbucketの設定」をすでに行っているので下記のような感じ

curlの組み込み

$ cd ~/sysad/
$ wget http://curl.haxx.se/download/curl-7.71.1.tar.gz
$ tar zxvf curl-7.71.1.tar.gz
$ cd curl-7.71.1
$ ./configure -prefix=/home/〇〇〇/opt
$ make
$ make install

※「http://curl.haxx.se/download/」から最新版を探す

gitの再インストール?

「--with-curl」と「--with-expat」を追記して、インストする必要あり。

$ cd ~/sysad/git-master/
$ make configure
$ ./configure --prefix=/home/〇〇〇/opt --with-curl=/home/〇〇〇/opt --with-expat=/〇〇〇/asabuds/opt
$ make -i all
$ make -i install

再度、確認するもエラー

▼「git pull」をしたときのエラー

fatal: unable to access 'https://bitbucket.org/〇〇〇/〇〇〇.git/': Protocol "https" not supported or disabled in libcurl

これは・・・SSL絡みらしい。

SSL絡み

Protocol "https" not supported or disabled in libcurl

SSLがあるかチェック

▼「curl -V」でSSLが組み込まれているか確認

$ curl -V
curl 7.71.1 (x86_64-pc-linux-gnu) libcurl/7.71.1 zlib/1.2.7
Release-Date: 2020-07-01
Protocols: dict file ftp gopher http imap pop3 rtsp smtp telnet tftp
Features: AsynchDNS Largefile libz UnixSockets

SSLが有効なら「Protocols」のトコに「https」がいるハズ。
※私の場合はいない。

対応

openSSLをいれてから、cURLをいれて、gitの再インストール(?)を行う

▼openSSL

$ wget https://www.openssl.org/source/openssl-3.0.0-alpha6.tar.gz
$ tar -zxvf openssl-3.0.0-alpha6.tar.gz
$ cd openssl-3.0.0-alpha6
$ ./Configure --prefix=/home/asabuds/opt/openssl linux-x86_64 no-asm no-hw shared
$ make
$ make install

※最新は「https://www.openssl.org/source/」にある

▼cURLの「./configure」はこんな感じにするっぽい

./configure -prefix=/home/〇〇〇/opt --enable-libcurl-option --with-ssl

結果と現状

結果

失敗

「curl -V」をするも「Protocols」のトコに「https」が含まれてくれない。
「cURL」を「make uninstall」をしてから「make install」をしても同様。

現状

お茶休憩していたら・・・いつのまにかSSLが使えるようになっていた

気持ち悪いのが・・・cURLのバージョン。
・私が試していたのは「curl-7.71.1」
・お茶休憩した後は「curl 7.29.0」
・・・他の人が対応してくれたのかな? とりあえず動くから問題無しとする

めも

「make install」したヤツは「make uninstall」でアンインストールができる。

関連項目

XSERVER+bitbucketの設定