I would like to checkout the latest commit on an active repository of any branch. That's the first commit when you sort your Bitbucket repo in the "Network" section.
My use case is a tool which uses code from latest changes in multiple submodules to analyze if those changes have led to a better evaluation metric. I'm doing it though a Jenkinsfile
I tried:
git checkout HEAD
but that only checks out the latest commit in the current branch.