GIT远程同步的问题
黄舟
黄舟 2017-04-21 11:17:31
0
2
546

以前一直用svn,转入git没多久,菜鸟一只 过去一直是在服务器的server目录下git init一个仓库,然后本地客户端通过SSH连接clone这个仓库。每次push之后,然后再通过服务器hooks执行git reset --hard。以同步。 我觉得这个方法肯定是有问题,请问能否更简单一些

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
伊谢尔伦

If the code warehouse on your server is only used as a code warehouse, that is, it is the same as the SVN warehouse, then you should use:

git init --bare

to initialize. The warehouse created in this way does not contain a working directory, so there is no need to use a hook to reset.

But if your server is also a production environment and you want the code to be automatically deployed every time you push it, you will inevitably need to clone a working directory on the server and use a hook to automatically synchronize the working directory after each push. .

左手右手慢动作

How to execute git reset --hard on server hook?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template