Skip to content

Instantly share code, notes, and snippets.

@piyushchauhan2011
Forked from ericclemmons/bump_version
Created November 14, 2021 11:17
Show Gist options
  • Save piyushchauhan2011/4b411363bf7a495796e5315e7e25f7b6 to your computer and use it in GitHub Desktop.
Save piyushchauhan2011/4b411363bf7a495796e5315e7e25f7b6 to your computer and use it in GitHub Desktop.
Bash script to merge, tag, & push the "develop" branch
#!/usr/bin/env bash
echo "Checking out master branch"
git checkout master
git pull origin master
git log master..develop
read -p "Review your changes..."
echo "Merging develop branch"
git merge develop
TAGSTAMP=`date +%Y-%m-%d.%H%M%S`
echo "Tagging as ${TAGSTAMP}"
git tag -a $TAGSTAMP
echo "Pushing commits and tags"
git push
git push --tags
echo "Checking out develop branch"
git checkout develop
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment