git - updating working files on the remote server
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 server
I have:A git repository created on a folder called
dev
with a bunch of files (I usedgit init
and thangit add .
- to add all those files to the repository).Then from that repository I 开发者_如何学编程created a branch called
master-copy
.On my
local machine
I created a clone from the remote server'smaster-copy
branch. Now every time when I make changes on my clonen copy I do a push to themaster-copy
branch 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.
精彩评论