Skip to content

Instantly share code, notes, and snippets.

@innocarpe
Last active September 6, 2019 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save innocarpe/66c410763fdcb61986ce306097017258 to your computer and use it in GitHub Desktop.
Save innocarpe/66c410763fdcb61986ce306097017258 to your computer and use it in GitHub Desktop.
Shortcut for git cherry-pick
#!/bin/bash
# It is equal to `git cherry-pick START_BRANCH^..END_BRANCH`
# 1. Move this file to ~/.gitsh/
# 2. Add directory path($YOUR_HOME_PATH/.gitsh) to environment variable file
# (like ~/.bash_profile or ~/.zshrc)
# (This would be like 'export PATH=${PATH}:/Users/YOUR_HOME_PATH/.gitsh')
# 3. chmod 0755 git-cp
# 4. Use the command 'git cp START_BRANCH END_BRANCH'
START_BRANCH=$1
END_BRANCH=$2
git cherry-pick $1^..$2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment