tags:

views:

24

answers:

1

Sometimes when switching branches using Git (version 1.7.2.1) it does not seem to remove the files/directories I created specific to the branch I switched away from. Neither does it list it as untracked when running git status or any log entries for those files.

This only happens occasionally and I'm not sure why or how to reset it so the files not belonging to the current branch gets deleted. If I delete the files manually, it gets in sync again (as in gets deleted/revived when switching branch).

Anyone experienced this?

+2  A: 

I have seen this too. I usually just do a git reset --hard followed by a git clean -f -d and it usually does the trick.

It seems to definitely happen the most often when my IDE has a lock on one of the files in the branch i'm switching from.

Climber104
The `git clean` part was what I was looking for, thanks! I should also add that some of the files might have been open in TextMate for editing
baloo
Climber104