How to structure git repository for a client-server project
Asked Answered
F

2

25

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?

Fanya answered 16/12, 2011 at 22:52 Comment(0)
D
27

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.

Disapprove answered 16/12, 2011 at 23:1 Comment(1)
Git subtrees helps with this a bit, you can have separate repositories but the files are mirrored and versioned in the encompassing repository.Godderd
A
1

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.

Anisomerous answered 16/12, 2011 at 22:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.