Skip to content

Instantly share code, notes, and snippets.

@renkin
Last active December 16, 2021 00:41
Show Gist options
  • Save renkin/900d436731224d8c50be89f0d875121e to your computer and use it in GitHub Desktop.
Save renkin/900d436731224d8c50be89f0d875121e to your computer and use it in GitHub Desktop.
Update current branch from branch "develop"
#!/bin/bash
MAIN_BRANCH=${1:-develop}
echo
echo "Fetching..."
git fe
echo
echo "Switching to $MAIN_BRANCH..."
git co $MAIN_BRANCH
echo
echo "Pulling $MAIN_BRANCH..."
git pull
echo
echo "Switching back..."
git co -
echo
echo "Merging $MAIN_BRANCH..."
git merge $MAIN_BRANCH
@renkin
Copy link
Author

renkin commented Feb 24, 2021

I use in the script the aliases. These aliases are defined in another gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment