将github链接到我的服务器

问题描述:

Github会跟踪我的更改,并使我可以轻松将我工作过的文件上传到存储库。

Github tracks my changes and makes it easy for me to "upload" only files that I've worked on to the repository.

然而,我必须上传他们到我的开发服务器,以及如果我想看到他们的工作。

However then I have to upload them to my development server as well if I want to see them work.

有没有办法让git客户端也推送到我的开发服务器?

Is there a way to have the git client push to my development server as well?

其他人如何处理这个效率问题?

How do others handle this issue of efficiency?

(到服务器上的回购):

You have to add a remote to your development server ( to the repo on the server):

git remote add devel url_to_repo

完成此操作后,您可以轻松地将其推送到开发服务器:

Once that is done, you can easily push to the development server:

git push devel master

如果你有空repo on devel(理想情况下应该是这样),你应该写一个post-receive脚本来检出这些文件。

If you are having a bare repo on devel ( as it ideally should be), you should write a post-receive script to checkout the files.