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:
- Your .project file is deleted.
- 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.
精彩评论