Created
July 6, 2018 07:53
-
-
Save maheshgawali/325225af50f3ec13849724cdbf55ae92 to your computer and use it in GitHub Desktop.
simple git merge script to merge current branch into a given branch
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/sh | |
# Usage: To merge current git branch into a branch called 'dev' and be back to the current branch | |
# ./git_merger.sh dev | |
target="$1" | |
current=`git branch | awk '/\*/{print $2}'` | |
git checkout ${target} | |
git pull origin ${target} | |
git pull origin ${current} | |
git push origin ${target} | |
git checkout ${current} | |
# This is extremely simple single purpose script, i normally use it in bashrc by putting this inside a function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment