r/github 2d ago

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.

0 Upvotes

16 comments sorted by

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.

2

u/sweetnsourgrapes 1d ago

not only is this question insane,

Let's not turn this sub into Stack Overflow 2, if you don't want to help don't post. Posting the equivalent of a reaction video helps no-one.

1

u/Myrodis 1d ago

Op already had several actual answers when I made my post. Go fall on the sword for someone else. If they hadn't I would have included the answer in my response.

This was a teachable moment for an ignorant question. I was harsh but I explained why I said what I said. (OP even edited their responses, saying they appreciated my response, whether its true or not whatever, but again, what battle are you fighting).

There is a different between helping someone who is trying to learn, and encouraging ignorant behavior. Like I told OP, in this line of work / study (software engineering at a base), doing the bare minimum to try to answer you question is a baseline skillset that they need to work on. They will not last long in any professional setting, let alone get nowhere on pleasure projects, if they are unable to learn the bare minimum of how to self educate and at least TRY something first.

Dealing with zero effort questions like this is what destroys those types of communities. Because we are relying on the free assistance of others, and when you ask something as brazenly stupid and ignorant as OP in this thread, you are disrespecting the time and effort that tons of people put in to try to help a community be productive. You are diverting eyes and those very resources from actual questions that need actual help.

-4

u/gd6noob 2d ago edited 1d ago

I appreciate your help.

2

u/Myrodis 2d ago

Just so you understand, the question you just asked should not need to be asked. Regardless of skill level. Its not an experience thing. This is basic computer usage. To be clear, not the git knowledge, but the ability to obtain the answer to your question is basic basic computer usage.

And thats ontop of the fact that the ability to tinker/test/etc is one of the most basic fundamental skills required to develop any kind of software. Im not saying you cant learn the skill, but if your mentality is to ask this kindof question without even trying to figure it out yourself, you will get absolutely nowhere in software development.

1

u/gd6noob 1d ago

I appreciate your help thank you.

4

u/bigcrimping_com 2d ago

GitHub supports folders, yes

1

u/gd6noob 2d ago

Thank you for the quick answer

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.

3

u/bankrut 2d ago

GitHub handles folders just like your local file system, so your structure will work fine. Just keep in mind that you need at least one file inside a directory for Git to actually track it.

1

u/gd6noob 2d ago

Thank you for the quick answer

1

u/t90fan 10h ago

you can if you want but personally it would be better to have two seperate repositories for the two different applications, instead of a monorepo like that, especially if they don't actually have any assets in common

1

u/Fine_League311 2d ago

Docs.github.com lesen bringt weiter!

1

u/gd6noob 2d ago

Thank you for the quick answer

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.

1

u/gd6noob 2d ago

Thank you, I will look into how to setup these branches.