managing website on windows using git

我与影子孤独终老i 提交于 2019-12-05 19:02:59

I ended up using these instructions to setup Cygwin + OpenSSH + Git which got me most of the way there.

http://www.shannoncornish.com/blog/2009/04/git-server-windows-2008/

In the post-receive I had to remove the first line #!/bin/sh due to some permission issues, and I added a symlink to my webroot from within Cygwin like so:

ln -s /cygdrive/c/inetpub/wwwroot /var/www

So the post-receive file ended up looking very similar to before but without the first line

GIT_WORK_TREE=/var/www/example.com git checkout -f
VonC

You can use a Windows path in your bash script (which will be interpreted by msysgit on windows).

/C/my/path/...

You can see here an example of a fairly complex post-checkout hook (not a post-receive, but it can illustrates what you can do on Windows in a bash hook script).

More details in "Combining mingw and git".

Actually, Adam Rofer mentions in the comments:

If you use normal windows sharing, you can access git repositories via this path syntax:

//computername/folder/repo.git 

assuming folder is the shared folder accessible to your login via normal windows folder sharing. Msysgit seems to play well with this.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!