Skip to content

Instantly share code, notes, and snippets.

@jeffpignataro
Created April 13, 2020 22:21
Show Gist options
  • Save jeffpignataro/b081e4727dbc13e7556f8daacb2d9622 to your computer and use it in GitHub Desktop.
Save jeffpignataro/b081e4727dbc13e7556f8daacb2d9622 to your computer and use it in GitHub Desktop.
@echo off
IF NOT "%~1"=="" GOTO Processing
@echo Missing argument for release branch name (ex REL_3.2)
@echo Exiting
EXIT
:Processing
cd \Repos\CS
@echo Working...
set sourceBranch=%1
@echo Checking out %sourceBranch%
git checkout %sourceBranch%
@echo Pulling %sourceBranch%
git pull
@echo Checking out develop
git checkout develop
@echo Pulling develop
git pull
set currentDate=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
set currentTime=%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%
set branchName=merge/%sourceBranch%-to-develop-%currentDate%-%currentTime%
@echo Checking out new branch - %branchName%
git checkout -b %branchName%
@echo Merge %sourceBranch% to %branchName%
git merge %sourceBranch%
@echo Push %branchName%
git push --set-upstream origin %branchName%
git checkout develop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment