Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

How to implement the equivalent of "git checkout" #50

Closed
davidfowl opened this Issue · 6 comments

4 participants

@davidfowl

Is there any way to update the working directory to a specific commit id or branch name? Basically the equivalent of "git checkout {branch name}" or "git checkout {somesha1}",

@nulltoken
Owner

Unfortunately, it's not implemented yet in libgit2.

@alex-shpilkin

It was mentioned on the mailing list that the problem with this is implementing gitattributes. Now that attributes are (somewhat) here, what else is needed for doing a checkout?

@nulltoken
Owner

@alex-shpilkin I think this question would get a better exposure (and therefore be better answered) in either the libgit2 issue tracker or the libigit2 mailing list. May I suggest you to ask it over there ?

@kaisellgren

Isn't this already implemented: https://github.com/libgit2/libgit2sharp/blob/vNext/LibGit2Sharp/Repository.cs#L373 ? (In the current vNext that is)

I guess this gets closed after it's released?

@nulltoken
Owner

@kaisellgren Not completely. The HEAD moves to the selected target, but the working directory is not updated with the content of the commit tree yet.

@nulltoken
Owner

Closing this as Repository.Checkout() now also takes care of updating the working directory (cf. CheckoutFixture.cs)

@nulltoken nulltoken closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.