My team alternates between usage of dev and master as default branch for several repos and I would like to write a script that checks for the default branch when entering a
Tested with git 2.9.4 (but possibly works in other versions) in a repo cloned from Github:
$ git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@' master