Skip to content

Basic Git clone fails when default branch is not 'main' #2041

Open
@fabjanvucina

Description

@fabjanvucina

Describe the bug
As the title suggests, cloning a Git repository into a Sandboxe without specifying a branch fails if the default branch for that repository is not 'main'

DaytonaError: "couldn't find remote ref \"refs/heads/main\"

To Reproduce
Steps to reproduce the behavior:

  1. Find Git repository with "master" as the default branch
  2. Run the following:
await sandbox.git.clone(
    "https://github.com/user/repo.git",
    "workspace/repo"
);

Expected behavior
Default repository branch is dynamically detected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions