github sub-repository in a single repository.

There are multiple projects belonging to a single business firm. But I want to import these projects to github. Instead of creating a separate repository for each project, when I want to add and pull to a repository, I want to get only the files that belong to that project.

creating a repository for each project makes it seem complicated.

example screnario;

There are two projects named A and B. These two projects depend on X.

With my current knowledge, I need to create two different repositories for projects A and B for myself.

instead of

When I create a repo named X and want to pull, I just want to pull and push project A.

From the description I’m not sure what exactly you’re trying to do, but maybe you’re looking for submodules? They let you create a reference to another repository into a repository, see: Git - Submodules

In most cases having one repository per project is the best approach.