Git tracks changes in files, not folders. If you just created folderb
, git wouldn't recognize it(even if you git add folderb
). If you moved all the files from foldera
to folderb
, git wouldn't know that foldera
still exists.
In other words, unless there is some plugin that tracks folders in git repositories, you can't discriminate between those two cases - because that information doesn't exist in the repository. Git doesn't know there are foldera
and folderb
- all it knows is that there are some files with foldera/
and folderb/
in their paths.