Skip to content

Use git log instead git rev-parse to get current branchΒ #41

@folmert

Description

@folmert

git rev-parse --abbrev-ref HEAD isn't very helpful, as it always returns HEAD when you're in detached HEAD state (i.e. when deploying via gitlab).

I suggest using git log -n 1 --pretty=%d HEAD instead, in detached HEAD state it produces a more meaningful output:
(HEAD, origin/sandbox/test_git_revision_plugin)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions