I've got my repo @ github. I did some work at home and pushed it to github. It involved some deleting of files and directories. Now I'm on my work box, which had a copy of the code before deleting the files and directories.
I issued the following:
git remote update
git checkout HEAD
git pull origin HEAD
It deleted all of the files it should have, but not the directories the files were in.
Two questions:
- Why did it not remove the directories?
- Is there a git command I can issue in the current state to remove them?
Git doesn't track directories, so it won't remove ones that become empty as a result of a merge or other change. However, you can use
git clean -fd
to remove untracked directories (the-fd
flag means force removal of untracked files and directories).