Created
May 16, 2019 07:23
-
-
Save blendsdk/534ae1b8cbc0ef2fba85611c697dc8c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curent_branch=$(git rev-parse --abbrev-ref HEAD) | |
exists=$(git show-ref refs/heads/$1) | |
back_branch=$1 | |
if [ -z "${exists}" ]; then | |
echo -e "\033[91mERROR: \033[0mInvalid or missing back branch ${back_branch}" | |
exit 1; | |
fi | |
echo -e "\033[96mINFO: \033[0m Merging \033[93m${curent_branch} \033[0monto \033[93m${back_branch}\033[0m" | |
read -p "Are you sure? " -n 1 -r | |
echo # (optional) move to a new line | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then | |
git checkout ${back_branch} | |
git merge --no-ff ${curent_branch} -m"Mergin ${curent_branch}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment