I am new to Git and I am having some problems when creating new folders.
I have a sparse-checkout of a repository (as I don't need the whole thing) and I created a new folder with some files in it, but as soon as I switch directory (either via terminal or even simply changing "location" on macOS Finder) and then come back to it, the folders are empty. To make it clear, the folders are still accessible, but the files I created in them are no longer present. This doesn't seem to be related to the state of the new files, meaning that even pushing them to the remote (which works properly, as I can see the newly created folders and files on the GitLab webpage) doesn't resolve the problem.
I did some testing by creating a new repository on GitHub and everything seems to work as expected. I can create new folders and subfolders with some files in them and these remain present even after switching directory.
I really have no idea what the problem could be. I tried to be as thorough as possible, thanks for the help.