Given two normal folders in a repo:
drwx------ dir_a/
drwx------ dir_b/
I convert dir_b to a relative symlink pointing to dir_a (i.e. rm -rf dir_b and ln -s dir_a dir_b so that now it looks like:
drwx------ dir_a/
lrwxrwxrwx dir_b -> dir_a/
After committing, pushing and pulling on another machine I see dir_b shown as a normal file and not as a folder symlink
$ ls -al
drwx------ dir_a/
-rw------- dir_b
Tried removing dir_b and restoring it with git checkout dir_b but it is still recreated as a file, and not a folder symlink. The file system is ext4 which supports symlinks. In fact, doing a fresh git clone on the same partition does create dir_b as a symlink as expected.
In case it could matter I'll mention that the actual name of dir_b starts with a dot (e.g. .dir_b).
git clone works correctly, so I could use it as a workaround, but would like to know what exactly is happening and what's the correct way to restore symlinked folders since apparently git checkout symlinked_folder does not recreate the folder as in the original repo.