@echo off git switch master || goto :error git pull || goto :error git switch test || goto :error git pull || goto :error git merge master || goto :error git push || goto :error git switch master || goto :error goto :EOF :error echo Failed with error #%errorlevel%. exit /b %errorlevel%