Skip to content

Instantly share code, notes, and snippets.

@devvspaces
Created February 14, 2023 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devvspaces/11bcb582a9d0a2ec59e9bb07c3850e36 to your computer and use it in GitHub Desktop.
Save devvspaces/11bcb582a9d0a2ec59e9bb07c3850e36 to your computer and use it in GitHub Desktop.
Batch script for quickly merging dev branch to main branch
@echo off
title Sync with Main Branch
echo Syncing with Main Branch...
@REM accept batch file arguments
set /p commitMessage=Commit Message:
@REM git add and commit
git add .
git commit -m "%commitMessage%"
@REM git push
git push
@REM go to main
git checkout main
@REM git pull
git pull
@REM merge
git merge dev
@REM git push
git push
@REM go to dev
git checkout dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment