When i try to use worktree checkout; it doesn't work and the code returns error
err = worktree.Checkout(&git.CheckoutOptions{
Create: true,
Branch: "main",
})
if err != nil {
log.Fatal("Cannot create 'main' branch\n" + err.Error())
}
Output:
[FATA] Cannot create 'main' branch
reference not found
I get the same error when i use
repository.CreateBranch(&config.Branch{
Name: "main",
})