git merge abort解决

来源:互联网 发布:安卓手机windows模拟器 编辑:程序博客网 时间:2024/06/10 17:55

在使用git的时候,一般用.gitignore文件来记录不需要上传到repo的文件。但是使用svn merge的时候,会因为这个文件导致svn merge之类的操作失败。

解决办法:

.gitignore文件使用

1.将不想提交到git的文件名称按照通配符的方式写入.gitignore文件中
2.git rm --cached .gitignore,将.gitignore文件从git local repo中删除
3.在执行git pusll origin master 或者 git pull origin other-branch命令的时候会出现类似如下的异常:


D:\workspace\hsfjetty-maven-plugin>git pull origin hsf2From https://github.com/littleJava/hsfjetty  * branch            hsf2       -> FETCH_HEAD  Updating 3cd7cf9..a465235  error: The following untracked working tree files would be overwritten by merge:         .gitignore  Please move or remove them before you can merge.  Aborting  

4.需要将.gitignore文件名也放入到.gitignore中

0 0