开发者

git - updating working files on the remote server

开发者 https://www.devze.com 2023-03-17 22:13 出处:网络
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

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:

  1. On the remote server I have:

    A git repository created on a folder called dev with a bunch of files (I used git init and than git add . - to add all those files to the repository).

    Then from that repository I 开发者_如何学编程created a branch called master-copy.

  2. On my local machine I created a clone from the remote server's master-copy branch. Now every time when I make changes on my clonen copy I do a push to the master-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.

0

精彩评论

暂无评论...
验证码 换一张
取 消