Reputation: 23
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.
Upvotes: 0
Views: 111
Reputation: 60235
git checkout :/.
The :/
syntax is "the most recent commit whose message contains a match for the expression", and .
is "any character".
Upvotes: 0