The Invincible A personal archive of software, founder life, travel, and the occasional detour.
Code Snippets

Git: find base branch of a branch

Switch to your branch and run the below ( whole line )

git show-branch -a \
| grep '\*' \
| grep -v `git rev-parse --abbrev-ref HEAD` \
| head -n1 \
| sed 's/.*\[\(.*\)\].*/\1/' \
| sed 's/[\^~].*//‘

Related

More posts like this

Behat Shortcuts

Run all Run single feature Run single scenario within a feature Where 10 is the line number of the first line of the feature Run all tests with a certain tag All tests except a certain tag Run multiple tags: Run tests tagged with @tagname1 AND @tagname2 AND NOT

Read more