Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 无法将代码推送到github_Ruby On Rails_Ruby On Rails 3_Git_Github - Fatal编程技术网

Ruby on rails 无法将代码推送到github

Ruby on rails 无法将代码推送到github,ruby-on-rails,ruby-on-rails-3,git,github,Ruby On Rails,Ruby On Rails 3,Git,Github,我尝试使用以下命令将代码推送到github: git remote add https://github.com/user/sample_app.git git push origin master 并得到以下错误: error: failed to push some refs to 'https://github.com/user/sample_app.git' To prevent you from losing history, non-fast-forward updates we

我尝试使用以下命令将代码推送到github:

git remote add https://github.com/user/sample_app.git

git push origin master
并得到以下错误:

error: failed to push some refs to 'https://github.com/user/sample_app.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'non-fast forward'
section of 'git push --help' for details.
要查看错误是否在我输入的遥控器上,请执行以下操作:

git pull
并得到以下错误:

error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://github.com/sub1010/sample_app.git/info/refs
fatal: HTTP request failed

为什么我不能将代码推送到github?

尝试添加ssh repo,而不是http repo本身

git remote rm sample_app
git remote add git@github.com/user/sample_app.git

Github提供了有关设置存储库并确保您可以连接存储库的详细说明。链接:和

Yuriy:我尝试了你的建议,在键入“git remote rm sample_app”时出现以下错误,错误:无法删除配置部分“remote.sample_app”@MrDanA:我只接受对我有用的答案打开你的.git/config文件并手动删除远程部分