Using Cloud9 and having problems because the .c9 folder was added to git. Trying to remove it. Git is asking me to remove a file before I can merge to the master branch. When I try to remove it, git tells me the file doesn't exist.
erikvdw@blog:~/workspace (master) $ git merge Post_initial_setup
error: The following untracked working tree files would be overwritten by merge:
.c9/metadata/workspace/.gitignore
Please move or remove them before you can merge.
Aborting
erikvdw@blog:~/workspace (master) $ git rm .c9/metadata/.gitignore --cache
fatal: pathspec '.c9/metadata/.gitignore' did not match any files
Since you want the entire .c9 folder to be ignored, keeping the .gitignore file within it doesn't make sense. Just update/create the .gitignore file within the workspace/repo root folder with a line added to ignore the .c9
folder. (Which I assume you've already done since git is saying your .c9/metadata/.gitignore file is untracked).
The error is happening because you've already committed the .c9 folder which had a .gitignore file inside. Now because of the updated global .gitignore file the current .c9/metadata/.gitignore
is untracked, but previously it was tracked. Since you no longer want to keep it around, I think its safe to remove the .c9/metadata/.gitignore
file, and not just from git (in which it doesn't exist now that its untracked, hence the error), but from the file system, so rm .c9/metadata/.gitignore
. (Or you may want to move it to another folder outside the git repo). Repeat similar steps for the other files you want to un-track.
Hope this helps.