Skip to content

Instantly share code, notes, and snippets.

@innocarpe
Created September 22, 2020 02:52
Show Gist options
  • Save innocarpe/9e1d0eed42d18e7bec104a8fd0a44dbd to your computer and use it in GitHub Desktop.
Save innocarpe/9e1d0eed42d18e7bec104a8fd0a44dbd to your computer and use it in GitHub Desktop.
Rebase latest base branch after pull when you working on a feature branch
#!/bin/bash
# This runs interactive rebase with short command.
# It is equal to `git pull --rebase origin BRANCH_NAME`
# 1. Move this file to ~/.gitsh/
# 2. Add directory path($YOUR_HOME_PATH/.gitsh) to environment variable file
# (like ~/.bash_profile or ~/.zshrc)
# 3. chmod 0755 git-reb
# 4. Use the command 'git reb BRANCH_NAME'
BRANCH_NAME=$1
git pull --rebase origin $BRANCH_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment