Skip to content

Instantly share code, notes, and snippets.

@artemsky
Created March 29, 2017 15:03
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save artemsky/321a06601eedc5ea8dbfbdc8756176d8 to your computer and use it in GitHub Desktop.
Save artemsky/321a06601eedc5ea8dbfbdc8756176d8 to your computer and use it in GitHub Desktop.
GIT - Get parent branch
git show-branch | grep '*' | grep -v "$(git rev-parse --abbrev-ref HEAD)" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment