Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to structure git repository for a client-server project

Tags:

I will be doing a project that will have a distinct server side (.NET) and client side (JavaScript) which can be developed separately. Does it make more sense to have them as 2 separate git repositories or should they be rather one? What advantages / disadvantages do these approaches have?

like image 480
Borek Bernard Avatar asked Dec 16 '11 22:12

Borek Bernard


People also ask

What is Git Client Server?

Git is a DevOps tool used for source code management. It is a free and open-source version control system used to handle small to very large projects efficiently. Git is used to tracking changes in the source code, enabling multiple developers to work together on non-linear development.


2 Answers

I'd recommend placing the code in two separate folders within the same git repository.

Main reason being that if you make changes to the server that require changes in the client it's easy to see the changes to both in the same change set.

If the client and server code were separate repositories you've have to try and determine manually which change set on the server corresponded to which change set in the client code base.

like image 80
Dan Rigby Avatar answered Oct 01 '22 02:10

Dan Rigby


Personnaly, i create two big folders, one for the client side and the other for the server.

For the client side (I use symfony), I use apache alias. So it's more simple and it's centralized.

Having two repository is the same but it's not as simple to switch between branches. For example, you change the security protocol. You will edit the two sides. So a branch is a good soluton. If you've two separated repositories, you cannot use the same branch.

like image 26
Gp2mv3 Avatar answered Oct 01 '22 02:10

Gp2mv3