Skip to content

LibGit2Sharp.Command.Checkout doesn't setup tracking to remote branch #1564

Closed
@splatteredbits

Description

@splatteredbits

I expect the LibGit2Sharp.Commands.Checkout function to checkout and setup a local tracking branch for remote branch names.

Here's my PowerShell code:

$checkoutOptions = New-Object -TypeName 'LibGit2Sharp.CheckoutOptions'
[LibGit2Sharp.Commands]::Checkout($repo, 'develop', $checkoutOptions)

This fails with a NotFoundException:

NotFoundException: No valid git object identified by 'develop' exists in the repository.

I would expected checkout to behave like the git checkout command and create a local branch to track the remote branch.

If/until this functionality arrives, can we document how to setup a local tracking branch?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions