Hello:
On Apr 7, 9:41 pm, "Roman Terekhov" <[EMAIL PROTECTED]> wrote:
> I like to write windows batch files with the git commands, that I want to
> execute together.
> But with the msysgit only the first command is executed while the the others
> are skipped.
> Any ideas why this happen?
I don't really understand why this happens, but I have a work around.
Try prefixing the desired git command with the cmd.exe command "call".
Example:
@rem This script checks out multiple repositories under a path.
@rem This is before I discovered git submodule. ;-)
@rem Obvious variable decls omitted.
set reps=my-git-repo-1 my-git-repo-2
for %%i in (%reps%) do (
if exist %%i (
cd %%i
echo ^>^>^>^> Updating %%i
call git.cmd pull -v
cd ..
) else (
echo ^>^>^>^> Checking out %%i
call git.cmd clone http://[EMAIL PROTECTED]/%parent_path%/%%i.git/
)
)
End Example
This worked for me under Git-preview20080301. There is a more recent
contribution on the origin/mob branch [1] that says "Exit
%errorlevel%", which might affect this behavior. I have not checked
it yet.
[1] b3f99268c117a7e8d369025d20e8ef3cdc70c0a0
Best regards,
Clifford Caoile