Reputation: 22191
I own two Git repositories:
ServerSide contains a client
folder, empty initially, needing to be feed by the code from the latest commit of ClientSide's master branch at deployment time. (I only need to deploy ServerSide, since it is aiming to bring client with it)
What I would like is an automatic strategy to pull the content from ClientSide's master branch into ServerSide.
Indeed, until now, each time I want to deploy ServerSide
, I use the manual (and very bad) strategy consisting in totally clearing the client
folder (rm -rf *
=> very risky), launching a process (bash for instance) that grabs content from my ClientSide's (pure cp
command) local master branch to the ServerSide's client
folder and commit/push the whole.
What would be a really efficient strategy to do the trick automatically?
Upvotes: 1
Views: 71
Reputation: 8138
In this case, ClientSide could be added to ServerSide as a submodule.
In ServerSide:
git submodule add <ClientSide> client
This creates a client directory linked with your ClientSide repository.
At deployment time:
cd client
git pull
# then commit the update of submodule client in ServerSide and deploy
Upvotes: 1