How do I push to the current git branch on remote, and have changes reflected immediately?

后端 未结 2 975
时光说笑
时光说笑 2021-01-19 04:44

I\'ve got a 2 web servers, one testing and one live. Both have their codebases managed with git.

I develop on the testing server, then push the changes from a master

2条回答
  •  半阙折子戏
    2021-01-19 05:11

    It sounds like you're pushing into a non-bare repo (that is, one that has a copy of the repo's files checked out on-disk). You can push into it, but Git won't automatically update the working-copy files without a git reset (or git checkout). You could use a post-receive hook to do the checking out automatically, though -- there's a good how-to available here.

提交回复
热议问题