【经验分享】git push 时出现的三种报错及解决方案
【经验分享】git push 时出现的三种报错及解决方案 最近在使用 git 进行 git clone 时,经常报错,经过查询找到了一种解决方案,分享给大家。文章目录【经验分享】git push 时出现的三种报错及解决方案一、第一种报错二、第二种报错三、第三种报错四、解决方案3.1 方案一3.2 方案二一、第一种报错 执行git push 提示 “fatal: unable to access
【经验分享】git push 时出现的三种报错及解决方案
最近在使用 git 进行 git clone 时,经常报错,经过查询找到了一种解决方案,分享给大家。
一、第一种报错
执行git push 提示 “fatal: unable to access 目标地址: Failed connect to github.com:443; Connection timed out”
[cos@VM-0-14-centos Exercise]$ git push origin master
fatal: unable to access 'https://github.com/cos/Exercise.git/'
: Failed connect to github.com:443; Connection timed out
二、第二种报错
执行git push 提示 “fatal: remote error: You can’t push to 目标地址 Use 目标地址”
[cos@VM-0-14-centos Exercise]$ git push origin master
fatal: remote error:
You can't push to https://github.com/cos/Exercise.git
Use https://github.com/cos/Exercise.git
三、第三种报错
执行git push 提示 “fatal: repository ‘目标地址’ not found”
[cos@VM-0-14-centos Exercise]$ git push origin master
remote: Repository not found.
fatal: repository 'https://github.com/cos/Exercise.git/' not found
四、解决方案
3.1 方案一
(1) 找到 ./git 文件夹。
(2) 进入 ./git 文件夹,找到 config 配置文件。
(3) vim config
打开 config 文件,修改配置文件中的远程地址url,保存并退出。
(4) 然后 git push origin master
推送到远端仓库。
3.2 方案二
(1) 使用下面这一条命令也可以完美解决。注意:user 需要替换成自己的用户名,xxx 需要替换成具体的分支。
git remote set-url origin https://github.com/user/xxx.git
(2) 然后 git push origin master
推送到远端仓库。
更多推荐
所有评论(0)