2017-03-01 26 views
1

我想從BitBucket上的遠程存儲庫中獲取。 git_remote_fetch返回錯誤消息:git_remote_fetch返回錯誤消息:「沒有可用的TLS流」

there is no TLS stream available 

有些想法如何解決這個問題?

這裏是我的代碼:

if(error = git_remote_fetch(remote, NULL,NULL,"fetch")!=0) { 
    const git_error *lastError = giterr_last(); 
    cerr << "problem with fetch, error message : '" << lastError->message <<"'"<< endl; 
} 

回答

0

我試圖用Python和pygit2(而這又取決於libgit2)從一個Git倉庫拉當得到了同樣的錯誤。我正在使用libgit2(0.25.0)的自編譯版本。

用以下標誌重新編譯libgit2解決了問題:cmake -DCURL=OFF如libgit2項目的issue#3786 [1]中所述。

與附加標誌編譯按照pygit2文獻[2]的全過程:

$ wget https://github.com/libgit2/libgit2/archive/v0.25.0.tar.gz 
$ tar xzf v0.25.0.tar.gz 
$ cd libgit2-0.25.0/ 
$ cmake -DCURL=OFF . 
$ make 
$ sudo make install 

確保刪除libgit2的build目錄,如果你一旦早期編譯它,否則該標誌將沒有任何效果。

[1] https://github.com/libgit2/libgit2/issues/3786
[2] http://www.pygit2.org/install.html#quick-install

如果您使用的操作系統的libgit的內置版本我建議不妨使用一個編譯版本。