Last active
          April 30, 2020 07:43 
        
      - 
      
- 
        Save ryangraham/ebe7c6a6ba3b680de3678f713a499cc0 to your computer and use it in GitHub Desktop. 
    rebase macro
  
        
  
    
      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
    
  
  
    
  | #!/usr/bin/env bash | |
| set -o errexit | |
| set -o pipefail | |
| set -o nounset | |
| set -o xtrace | |
| GIT_ROOT=$(git rev-parse --show-toplevel) | |
| pushd "$GIT_ROOT" || exit | |
| CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
| echo "Current branch: $CURRENT_BRANCH" | |
| echo "Checking out master..." | |
| git checkout master | |
| git pull | |
| echo "Rebasing..." | |
| git checkout "$CURRENT_BRANCH" | |
| git rebase master | |
| echo "Done." | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment