git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Run git from .bat file (Windows)
@ 2010-07-20 16:34 Markus Heller
  2010-07-20 17:34 ` Peter Harris
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Heller @ 2010-07-20 16:34 UTC (permalink / raw)
  To: git

Hello,

I'm trying to get the script below working on a box with Windoze XP and
git version 1.7.0.2.msysgit.0.  The script is a .bat file and is
supposed to be run from the Windoze scheduler; for testing, I run it
from a command prompt.

Here's the script:

=================8<==================8<=====================
@ECHO OFF

REM get date and time
for /f "delims=" %%a in ('date/t') do @set mydate=%%a
for /f "delims=" %%a in ('time/t') do @set mytime=%%a
set fvar=%mydate%%mytime%

REM add all new files
git add .
git commit -a -m "Automated commit by org-git-sync.bat on %fvar%"
================>8===================>8======================

The line "git add ." works, as I can see the additions when I type "git
status" after executing the script.  Committing doesn't work, however:
"git log" shows that no commit was created.

Any idea what's going on?

Thanks
Markus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Run git from .bat file (Windows)
  2010-07-20 16:34 Run git from .bat file (Windows) Markus Heller
@ 2010-07-20 17:34 ` Peter Harris
  2010-07-20 18:44   ` Markus Heller
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Harris @ 2010-07-20 17:34 UTC (permalink / raw)
  To: Markus Heller; +Cc: git

On Tue, Jul 20, 2010 at 12:34 PM, Markus Heller wrote:
> git add .
> git commit -a -m "Automated commit by org-git-sync.bat on %fvar%"

> The line "git add ." works, as I can see the additions when I type "git
> status" after executing the script.  Committing doesn't work, however:
> "git log" shows that no commit was created.
>
> Any idea what's going on?

git itself is wrapped by a batch file on Windows. You need to "call" it. eg:

call git add .
call git commit ...

("call /?" for more details)

Peter Harris

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Run git from .bat file (Windows)
  2010-07-20 17:34 ` Peter Harris
@ 2010-07-20 18:44   ` Markus Heller
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Heller @ 2010-07-20 18:44 UTC (permalink / raw)
  To: git

Peter Harris <git@peter.is-a-geek.org> writes:

> On Tue, Jul 20, 2010 at 12:34 PM, Markus Heller wrote:
>> git add .
>> git commit -a -m "Automated commit by org-git-sync.bat on %fvar%"
>
>> The line "git add ." works, as I can see the additions when I type "git
>> status" after executing the script.  Committing doesn't work, however:
>> "git log" shows that no commit was created.
>>
>> Any idea what's going on?
>
> git itself is wrapped by a batch file on Windows. You need to "call" it. eg:
>
> call git add .
> call git commit ...

Ah, I wasn't aware of this!!

Thanks for your reply, works as advertised!!

Cheers
Markus

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-20 18:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-20 16:34 Run git from .bat file (Windows) Markus Heller
2010-07-20 17:34 ` Peter Harris
2010-07-20 18:44   ` Markus Heller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).