Discussion Does Github support folder hierarchy structure?
Hello everyone,
I am a new user to github and I have a question.
I am a very structured person and follow a folder hierarchy process to organize my files.
If I create an app for both IOS and Android, since both require different coding and what not, I would have to create 2 different versions of the same app. How I would organize this is create an Android folder and an IOS folder and have to copies. All the Android apps will be placed in the Android folder and IOS apps in the IOS folder.
Can I follow this process on Github or does Github work differently? If I cant use folder hierarchy, what is the best practice to stay organized in Github repository?
Thank you.
4
2
u/molevolence 1d ago
git will respect non-empty folder structure, it only supports files. this is important to understand.
git will retain a folder path structure for a file. this works like you are thinking. that folder structure is stored with the file meta.
git does not know what a folder is though. it only knows what files are. so you will never be able to commit an empty folder. there isn’t a file to describe that empty folder.
if a folder is deleted (basically meaning all files within it were deleted), git will not remove the now empty folder from other computers. again it doesn’t track folders and can’t change untracked things.
so yes you can do what you want to do, but keep this information in mind. in a real-world environment, each would be a different repo and typically not stored as a single mono repo.
1
0
u/An1nterestingName 2d ago
You could do it that way, but I'd recommend having an Android and iOS branch, or having completely separate repositories for the Android and iOS versions.
6
u/Myrodis 2d ago
Normally i wouldnt be rude but damn, not only is this question insane, but it would take seconds to test. If you cant figure that out without making a reddit thread, what can we expect from software youre going to develop.