Availability:
:- use_module(library(git)).
(can be autoloaded)- git_default_branch(-BranchName, +Options) is det
- True when BranchName is the default branch of a repository. This is
hard to define. If possible, we perform
rev-parse
onorigin/HEAD
. If not, we look at branches shared between the local and remote and selectmain
ormaster
or the first common breach. Options:- remote(+Remote)
- Remote used to detect the default branch. Default is
origin
.
- git_default_branch(-BranchName, +Options) is semidet
- True when BranchName is the current branch of a repository. Fails if the repo HEAD is detached