Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7989921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:52:26+00:00 2026-06-04T12:52:26+00:00

I wrote a batch to check and deploy the rails app from github, the

  • 0

I wrote a batch to check and deploy the rails app from github, the batch file see below. The problem is git.exe fetch origin | find "remote: Counting Objects" always returns errorlevel 1, even when we have new commits. I must terminate the Rails App first, because some files are locked (*.jars) and cause the git pull command to fail.

I search and found below topic, but even using git.exe instead of the git.cmd, the problem still exists.

  • Check if pull needed in Git
  • git bash : how to check if there's a new commit available

I try to using a temp file to store git.exe fetch origin result, but if seems this command always print the result to the console.

Also:

git pull | find "Already up-to-date."
if %errorlevel% == 1 (

Works fine

    REM @echo off
    set path=%path%;C:\Program Files\Git\bin;D:\jruby-1.6.7\bin
    set JRUBY_OPTS=--1.9
    git.exe fetch origin | find "remote: Counting objects"
    if %errorlevel% == 0 taskkill /f /im:jruby.exe
    git pull | find "Already up-to-date."
    if %errorlevel% == 1 (
    REM 
      start cucumber.bat
      REM do something else when update
    )

    REM RAILS
    tasklist | find "jruby.exe"
    if %errorlevel%==1 (
     echo @rails s > rail.bat
     echo @exit >> rail.bat
     start cmd /c rail.bat
    )
    exit

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:52:27+00:00Added an answer on June 4, 2026 at 12:52 pm

    At a guess I’d say it’s breaking because the ‘Counting objects’ line shows a dynamic progress indicator, but don’t quote me on that.

    ...
    git fetch origin
    git branch -a --no-merged |find "remotes/origin"
    if %errorlevel% == 0 taskkill /f /im:jruby.exe
    ...
    

    You might also want to limit it to just the current branch:

    git branch -a --no-merged |find "remotes/origin/mybranch"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a batch file that uses the program curl.exe to download a database
I want to write a batch file that performs the following operations: Check if
I never wrote a batch file, and now I have to write a batch
I have this simple little batch file program that I wrote but it fails
The following snippet is from a little app I wrote using the Qt framework.
I wrote a simple batch file to run Frequently Used websites based on a
I've wrote some code to batch delete/insert sections and cells from/into a table view.
Problem: I wrote a hello world java program, compiled and created a jar file
I'd like to write a batch file that checks to see if a process
I'm using getopt to parse options and arguments. I wrote a batch file to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.