I have a remote development server and every time when I do a code change on my local machine I need to make sure the code I’ve changed works properly on the dev (remote server).Below is the setup I have so far:
-
On the
remote serverI have:A git repository created on a folder called
devwith a bunch of files (I usedgit initand thangit add .– to add all those files to the repository).Then from that repository I created a branch called
master-copy. -
On my
local machineI created a clone from the remote server’smaster-copybranch. Now every time when I make changes on my clonen copy I do a push to themaster-copybranch on the remote server.
Is there a way to update the files located on dev folder (on the remote server) when I do I push from my local machine cloned copy to the master-copy branch (on the remote server)?
You should look at git-receive-pack for information on installing hooks which are triggered when you push to a repository.
See Git Book for some examples of scripts which can checkout for you after pushing.