Creation of two projects in single Git repository

6

I am creating a project in Java web and want to create another project in Android. But I would like to create just one repository and within it own these two projects with their respective commits trees, as if they were separate components.

Is it possible to create something like this in Git?

    
asked by anonymous 07.10.2015 / 04:39

1 answer

7

Not possible. Git has its advantages, but one of the disadvantages is just that. Git works with the repository as a whole. In fact it is more common when you need better organization and access control to have a separation of projects in parts and each have its own repository.

Of course you can, although not recommended, put both in the same repository, but it will be one thing only from Git's point of view. You can do this, but any attempt to administer it as if it were separate things will bring more confusion.

Split into two repositories and be happy. You do not have to do this.

If you want to insist on this, have a solution in the OS . Do not think that it is simple to deal with this correctly. I do not know if you have everything you want and most of all it makes up for the effort, especially when something goes wrong.

In your case, it seems to me that the projects are so distinct that it would not be worth even trying to put everything in a single repository.

And of course if you want to treat as one thing, there is no secret.

    
07.10.2015 / 11:25