频道栏目
首页 > 资讯 > HTML/CSS > 正文

windows使用git时会出现的常见操作问题解答

17-05-25        来源:[db:作者]  
收藏   我要投稿

windows使用git时会出现的常见操作问题解答。终于稍微会一点git了,所以赶紧把遇到的问题记录下来:
1、warning: LF will be replaced by CRLF
windows中的换行符为 CRLF, 而在Linux下的换行符为LF,所以在执行add . 时出现提示,解决办法:

$ rm -rf .git          // 删除.git  
$ git config --global core.autocrlf false      //禁用自动转换 

然后重新执行:

$ git init    
$ git add .  

2、fatal: remote origin already exists
输入$ git remote add origin 项目地址时出现出错信息;
解决办法:

$ git remote rm origin
$ git remote add origin 

然后再输入项目地址 就不会报错了。
3、error:failed to push som refs to …….
输入$ git push origin master时出现出错信息;
解决方法:

$ git pull origin master   //先把远程服务器github上面的文件拉下来
$ git push origin master

4、 fatal: Couldn’t find remote ref master或者fatal: ‘origin’ does not appear to be a git repository以及fatal: Could not read from remote repository.
重新输入

$ git remote add origin 项目地址
相关TAG标签
上一篇:CSS3-新增背景系列background
下一篇:手把手教你使用ECharts绘制可视化图表
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站