Show all commits the current feature branch has:
$ git show -s $(./git-branch-commits.sh)
Cherry-Pick all commits the specific pull request (checked out as branch) has:
$ git cherry-pick $(./git-branch-commits.sh pr/2215)
#!/bin/bash | |
branch=$1 | |
base=${2:-master} | |
if [ -z "$branch" ]; then | |
branch=$(git branch --show-current) | |
if [ -z "$branch" ]; then | |
echo "Provide a branch!" | |
exit 1 | |
fi | |
fi | |
git rev-list --reverse $branch --not $(git rev-list $base ^$branch --merges | tail -1)^ |