Git: Untracked files problem
I edited my working copy of a project in git and now I can't do a git pull to merge, because I added a few files. I don't have commit privileges on the remote project, so I emailed them to the maintainer, and now git won't merge them in. I get this error:
error: The following untracked working tree files would be overwritten by merge:
There are two ways to handle this:
git add .
Adds the names of the files in the local copy, to git's concept of tracked files. Then agit fetch
will succeed.git clean -n
will do a dry run (-n
) of a clean operation, which will remove all non-tracked files from your local copy. If you agree,git clean -d
will actually delete thosee files; thengit fetch
orgit pull
will succeed.