Last active
August 29, 2015 14:08
-
-
Save expede/45aba6ae7268898c49e4 to your computer and use it in GitHub Desktop.
git debase
This file contains hidden or 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
# Similar to a squashed rebase | |
# Merges branch A into B, and then resets the branch to A, | |
# producing an unstaged diff of B for your commit | |
# exampe usage: `debase master` | |
# (note the lack of `git` prefix) | |
function debase() { | |
if [[ -z $1 ]]; then | |
echo 'missing branch to debase from' | |
else | |
branch=${1} | |
git merge `echo $branch` && git reset --soft $branch && git status | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment