Git 使用问题解决(未完待续)

1.在Eclipse使用git pull从远程仓库获取项目到本地时遇见:

Who@WHO-PC /G/Works/JAVA/BookShareClient (master)
$ git pull
error: The following untracked working tree files would be overwritten by merge:

gen/com/example/bookshare/BuildConfig.java
gen/com/example/bookshare/R.java
Please move or remove them before you can merge.
Aborting

 

解决:首先使用git commit -m "msg" -a想要对这两个文件先提交,但是这两个文件无法commit,然后使用git rm file命令想要直接删除这两个文件,发现不行(=。=),竟然找不到这两个文件,ls一下明明就有这两个文件,然后灵机一动想要试试git add file,然后报错说该文件由于.gitigonre文件的问题而被忽略,不能add,这里真心大坑,进去之后找到了一个神坑的.gitignore将该文件夹内的东西都忽略掉(而之所以会出现这种情况,可能是因为在不同的两个地方进行配置,其中一个地方在该文件夹没有配置.gitignore,而另一个地方配置了,导致最终pull时git无法正确管理),然后继续add file,再commit,给了些警告,但是不管,然后pull成功。

posted @ 2014-03-29 01:24  辛力啤  阅读(28796)  评论(1编辑  收藏  举报