Last active
September 14, 2023 11:38
-
-
Save iagoalonsomrf/f4e6e3cb1e9c1dfe3c38eaa21f11e29d to your computer and use it in GitHub Desktop.
Merge the default branch into yours, even if it's in a dirty state
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
#!/usr/bin/env bash | |
DEFAULT_BRANCH="master" | |
CURRENT_BRANCH=$(git branch --show-current) | |
git stash | |
git checkout "$DEFAULT_BRANCH" | |
git pull | |
git checkout "$CURRENT_BRANCH" | |
git merge "$DEFAULT_BRANCH" | |
git stash pop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment