很多人遇到这个错误就不用http而改用ssh了,其实这并不方便,改用ssh的方法我已经转载在我的博客里面。大家可以参看,要流血流汗的。
我这里用的方法是还是用http的方法
首先
vim .git/config
修改
- [remote "origin"]
- url = https://github.com/xxx/example.git
- [remote "origin"]
- url = https://xxx@github.com/xxx/example.git
(gnome-ssh-askpass:13916): Gtk-WARNING **: cannot open display:
我的解决方案是在terminal输入下面的命令
unset SSH_ASKPASS
and then running git push origin master
works the way it should. You can also add the line to your .bashrc
file.