git 异常
来源:互联网 发布:python rqalpha 编辑:程序博客网 时间:2024/05/16 17:23
1.首次安装时.如何切换git的默认目录?
打开桌面快捷方式,删除目标结尾“--cd-to-home”.修改起始位置为需要修改的启动目录.
2.添加当前文件夹中所有文件到上传列表中报错.
$ git add .
warning: LF will be replaced by CRLF in .idea/compiler.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/gradle.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/misc.xml.
..........
解决办法:
下面命令好像是设置全局代码自动换行 的状态为false
$ git config --global core.autocrlf false
3.最后一步上传出错
$ git push -u origin master
Username for 'https://git.oschina.net': mygit
To https://git.oschina.net/mygit/Jpush.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://git.oschina.net/mygit/Jpush.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
解决办法:
1重新添加远程仓库地址.
$ git remote add origin https://git.oschina.net/mygit/Jpushgit
fatal: remote origin already exists.
A.1添加远程仓库地址出错
解决办法: 删除远程仓库.
$ git remote rm origin
B.重新添加远程仓库地址.
$ git remote add origin https://git.oschina.net/mygit/Jpushgit
C.执行数据上传
$ git push -u origin master
Username for 'https://git.oschina.net': mygit
Counting objects: 117, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (87/87), done.
Writing objects: 100% (117/117), 17.14 MiB | 327.00 KiB/s, done.
Total 117 (delta 20), reused 0 (delta 0)
remote: Resolving deltas: 100% (20/20), done.
To https://git.oschina.net/mygit/Jpush.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin by rebasing.
D.上传完成.
4.问题3还有一种解决办法:
使用命令
$ git pull --rebase origin master 合并远程仓库文件到本地.然后再次进行上传.
5.上传文件时出错:
error: src refspec master does not match any..
错误信息上传为内容为空.git上传到远程仓库时需要先用<git add上传的文件名.md> 将上传的文件添加到上传队列.
6.git操作错误及解决办法集合.
参考博客:
http://blog.csdn.net/dengjianqiang2011/article/details/9260435
- git 异常
- GIT 第一次 clone 异常
- git一次push异常
- git 错误异常
- git clone 异常现象
- Git之常见异常收集
- git使用异常——git push --tags
- Ubuntu10.04安装Git异常汇总
- Ubuntu10.04安装Git异常汇总
- Git插件push时报异常java.util.NoSuchElementException
- java.lang.ClassNotFoundException: org.git.mm.mysql.Driver异常处理
- golang go get出现"go: missing Git command"异常
- GIT 提交异常 fatal: LF would be replaced by CRLF
- 电脑突然死机导致远程git项目异常问题解决
- git did not exit cleanly (exit code 1) 异常处理
- Git异常fatal:The remote end hung up unexpectedly
- Jenkins连接git时异常 Failed to connect to repository
- 异常好用的分布式版本控制软件Git入门
- 三种方法求最大公约数
- 标题:带分数
- 堆排序(C语言实现)迭代
- 1231231
- 学习C#-推荐网站
- git 异常
- 《Html5,基础知识、核心技术与前沿案例》阅读笔记- 待续
- c#学习第二天(今天)0.0 嘿
- 2017年清华大学计算机科学与技术系考研小结
- Linux下编写第一个c语言程序hello world
- cccc L2-009. 抢红包
- java 基本数据类型
- openssl命令详解
- Nuc