0

I have 2 directories in my repo, and I am trying to delete one of them, let's call it TestA, which contains a folder, and inside it contains a doc. It will be: TestA >>> subTestA >>> TestDoc

When I try to delete TestA, typing git rm -r TestA or git rm -rf TestA, instead of deleting the whole thing, it is only deleting the TestDoc, leaving behind my two folders - TestA and subTestA, which is still present in my local repo..

The master repo is not showing both the folders (empty dirs will not be shown right?) and the TestDoc... So where am I doing it wrong?

By the way, I am referencing from this link..

Community
  • 1
  • 1
dissidia
  • 1,531
  • 3
  • 23
  • 53
  • Git does not track directories, only file contents. What do you see when you run `git status` after running `git rm -rf TestA`? –  Apr 10 '14 at 05:47

1 Answers1

1

When I try to reproduce this behavior (with Git 1.8.3.2), git rm -r TestA will delete the directory from my repo and from my local filesystem.

However, since the directory is still present in your filesystem but not tracked by Git anymore, what about removing it manually (rm -rf TestA)?

You could also run git clean -fxd to let git remove everything it doesn't track (but take care: this command will actually remove every file and directory it doesn't track)

gturri
  • 13,807
  • 9
  • 40
  • 57
  • 1
    I tried the -rf method as well. and I am still getting the same error, no idea why is that so... In the end, I just removed it manually from the system instead of using the git commands... – dissidia Apr 11 '14 at 02:50