Skip to content

Instantly share code, notes, and snippets.

@in8finity
Last active December 22, 2016 14:56
Show Gist options
  • Save in8finity/99c046ba36768e04b8aca9faba2a64a5 to your computer and use it in GitHub Desktop.
Save in8finity/99c046ba36768e04b8aca9faba2a64a5 to your computer and use it in GitHub Desktop.
Bash script to find diffs only in files from your feature between stage with multiple features
#!/bin/bash
STAGING_BRANCH=staging
DEVELOP_BRANCH=develop
BRANCH_NAME=`git branch --list | fzf`
COMMON_PARENT_COMMIT_HASH=`git merge-base $BRANCH_NAME $DEVELOP_BRANCH`
comm -12 <(git diff $BRANCH_NAME staging --name-only) <(git diff $COMMON_PARENT_COMMIT_HASH $BRANCH_NAME --name-only) \
| xargs -I{} git diff staging $BRANCH_NAME -- {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment