git的窗户拉后 [英] git windows post pull

查看:96
本文介绍了git的窗户拉后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近从SVN转换。
我的服务器是Windows下的(不要怪我,这是不是我的选择:}

I have recently converted from svn. My server is under Windows (don't blame me, it wasn't my choice :}

我创建了一个回购与两个分支主和稳定。

I have created a repo with two branches "master" and "stable".

在我的服务器我想从稳定分支获得的文件。

On my server I want to get files from stable branch.

我已经做了:

git clone git://url/.git src
cd src
git checkout --track -b stable origin/stable

previously我有一个蝙蝠脚本

Previously I had a .bat script

cd my_repo_dir
svn update
echo APPLICATION_STAGE = 'production' > conf\__init__.py
net stop apache2.2
net start apache2.2

和它的工作,现在用git

and it worked, now with git

cd my_repo_dir
git pull
echo APPLICATION_STAGE = 'production' > conf\__init__.py
net stop apache2.2
net start apache2.2

什么也不GIT中拉后执行,无论是成功的,或最多为最新。
它只是退出没有警告提示。

nothing is executing after git pull, whether it is successful, or up-to-date. It just exits to prompt with no warning.

我想过挂钩。
我已经创建了:

I thought about hooks. I have created:

.git/hooks/post-receive
.git/hooks/post-update

具有相同内容的两个文件:

both files with the same contents:

echo APPLICATION_STAGE = 'production' > conf\__init__.py
net stop apache2.2
net start apache2.2

和不,它不执行要么...
也许我缺少跨preTED报关行(#!/ bin /在* nix的SH)
但我不知道它是什么样的窗户...

and nope, it is not executing either... Maybe I am missing interpreted declaration line (#!/bin/sh on *nix) but I am not sure what it is on windows...

推荐答案

几点:


  • 请确保您已经在路径git.exe。做一个其中混帐,你必须把像

C:\Program Files (x86)\Git\bin\git.exe

如果git.cmd正在使用(从C:\\ Program Files文件(x86)的\\的Git \\ CMD \\ git.cmd),你要做的通话混帐拉它继续执行。我想说添加 git.exe 来的路径,并开始使用它。

If git.cmd is being used ( from C:\Program Files (x86)\Git\cmd\git.cmd ), you have to do call git pull for it to continue execution. I would say add git.exe to path and start using it.

即使在Windows上,您必须具备家当! - #/ bin / sh的的钩才能正常运行

Even on Windows, you must have the shebang - #!/bin/sh for the hooks to properly run.

如果你想有一个钩子上拉跑,你可能想使用后合并挂钩。 后接受更新后,当你推到他们的远程回购运行。

If you want a hook to run on pull, you probably want to use the post-merge hook. post-receive and post-update run on remote repos when you push to them.

这篇关于git的窗户拉后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆