Does Git store history when an empty directory was created?

I am converting Subversion to Git recently using git-svn.
I know that I have to add .gitkeep to add an empty directory in Git.
Does it mean that Git does not store history when a directory was created?

My Subversion repository has many empty directories and if I added .gitkeep to all empty directories for Git, it means that the directories’ history wwas seen as if they were created now, not the exact days when the empty directories were created.

  • git svn clone failed
  • Cannot do git-svn fetch behind proxy
  • Listing Local and Remote Git Repos using Git shell
  • SVN to Git conversion with renamed trunk
  • Push existing Git repo to a folder in svn
  • Doing git svn rebase after using git-subtree
  • git bundle with git-svn
  • How to detach the local git repository from its working directory?
  • 2 Solutions collect form web for “Does Git store history when an empty directory was created?”

    No, Git does not store information about directories. git-svn has facilities to take care of this for you.

    git svn clone --preserve-empty-dirs will take care of empty directories for you while cloning. It will create a placeholder file to track empty directories (by default .gitignore) and remove them as appropriate.

    git-svn also stores untracked empty directories. git svn mkdirs can be used after a checkout or reset to recreate empty directories.

    Finally there is the svn-remote.<name>.automkdirs config value to control whether git svn clone and git svn rebase will run git svn mkdirs for you.

    You can’t add directories to Git, only files. So yes, Git doesn’t know when empty directories were added–because empty directories can never be added.

    Git Baby is a git and github fan, let's start git clone.