[英]Git, fatal: unable to access 'https://github.com/path/to/repo.git': gnutls_handshake() failed: Error in the pull function
And when I run this: $ git push -u origin master
当我运行这个: $ git push -u origin master
I got an error: > fatal: unable to access 'https://github.com/path/to/repo/': gnutls_handshake() failed: Error in the pull function.
我收到一个错误: > fatal: unable to access 'https://github.com/path/to/repo/': gnutls_handshake() failed: Error in the pull function.
I have tried the methods from this page , and it didn't work out. 我已经尝试了此页面中的方法,但没有奏效。
One of the methods in the above link:上述链接中的方法之一:
$ mkdir ~/git-rectify
$ cd ~/git-rectify
$ sudo apt-get source git
$ sudo apt-get update
$ apt-get source git
$ sudo apt-get build-dep git
$ sudo apt-get install libcurl4-openssl-dev
$ dpkg-source -x git_x.x.x-1ubuntu0.1
$ sudo dpkg-buildpackage -rfakeroot -b
$ sudo dpkg -i git_x.x.x.x-1_amd64.deb
I ran the sixth line: $ sudo apt-get build-dep git
我跑了第六行: $ sudo apt-get build-dep git
After running, I got the error:运行后,我收到错误:
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
builddeps:git : Depends: gettext but it is not installable
Depends: libpcre3-dev but it is not installable
Depends: libcurl4-gnutls-dev but it is not installable
Depends: libexpat1-dev but it is not installable
Depends: subversion but it is not installable
Depends: libsvn-perl but it is not installable
Depends: libyaml-perl but it is not installable
Depends: tcl but it is not installable
Depends: libcgi-pm-perl but it is not installable
Depends: libmailtools-perl but it is not installable
Depends: cvs but it is not installable
Depends: cvsps but it is not installable
Depends: libdbd-sqlite3-perl but it is not installable
Depends: libio-pty-perl but it is not installable
Depends: debhelper (>= 9) but it is not installable
Depends: dh-exec (>= 0.7) but it is not installable
Depends: dh-apache2 but it is not installable
Depends: asciidoc (>= 8.6.10) but it is not installable
Depends: xmlto but it is not installable
Depends: docbook-xsl but it is not installable
E: Unable to correct problems, you have held broken packages.
You sources.list is misconfigured, edit your /etc/apt/sources.list
as follows:你的 sources.list 配置错误,编辑你的/etc/apt/sources.list
如下:
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://archive.canonical.com/ubuntu/ bionic partner
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://archive.canonical.com/ubuntu/ bionic partner
Then run:然后运行:
sudo apt update
sudo apt upgrade
sudo apt-get build-dep git
Recently I have faced this problem when I clone any repo from GitHub or create any new repo.最近,当我从 GitHub 克隆任何 repo 或创建任何新 repo 时,我遇到了这个问题。 After working in the repo when I push my changes or going to push my new work repo to GitHub I get this error.在我推送更改或将我的新工作存储库推送到 GitHub 时在存储库中工作后,我收到此错误。 I think this happens when your GitHub account is not configured globally with your Linux machine.我认为当你的 GitHub 帐户没有在你的 Linux 机器上全局配置时,就会发生这种情况。
You can use $ git push -u origin master --force
this worked for me.您可以使用$ git push -u origin master --force
这对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.