git merge abort解决

在使用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 hsf2
From 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
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值