开发者

Error when doing git pull, unable to resolve

I'm getting this git error and I don't really get what it means, nor how I can fix it:

(v_env)[nubela@nubela-desktop searchplus]$ git pull origin master
From file:///home/nubela/Workspace/_git/searchplus
 * branch            master     -> FETCH_HEAD
Updating 38f3d5b..fe6028c
er开发者_运维技巧ror: Untracked working tree file 'searchplus/.project' would be overwritten by merge.  Aborting
(v_env)[nubela@nubela-desktop searchplus]$

I've done the following but to no avail:

git clean -f -d
git reset --hard HEAD

Anyone can help enlighten me? Thanks :)


You (or your IDE) has created a file named "searchplus/.project". Somewhere in the upstream Git repository, this file has been also created. Git refuses to do the merge step unless:

  1. Your .project file is deleted.
  2. Your .project file is committed, so a merge can be attempted.


It basically means exactly what it says. You have a file in your working copy that is not in your repo, but is in the remote repo. Merging in the remote would clobber your copy of the file. The easiest way you can resolve this is by committing the file or removing it.


Try

git clean -fx

The -x switch will remove ignored files. maybe the file .project is ignored by your git repository, so git clean won't remove it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜