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中
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章