Skip to content

Instantly share code, notes, and snippets.

@TomSchober
Last active September 6, 2017 19:03
Show Gist options
  • Save TomSchober/d136fa766bd6e4ed8b086eb3460c4766 to your computer and use it in GitHub Desktop.
Save TomSchober/d136fa766bd6e4ed8b086eb3460c4766 to your computer and use it in GitHub Desktop.
Git Branch Base
#!/usr/bin/env bash
branch_name=$1
branch_base_name=$2
git checkout ${branch_name}
merge_base=`git merge-base ${branch_name} ${branch_base_name}`
branch_commit_date=`git show --summary ${merge_base} --pretty=tformat:'%aI'`
echo ${branch_name} Branched off ${branch_base_name} at: ${merge_base}
echo ${branch_name} Branch Point Commit Date: ${branch_commit_date}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment