Skip to content

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

davidfowl opened this Issue Jun 26, 2011 · 6 comments

4 participants


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}",

libgit2 member

Unfortunately, it's not implemented yet in libgit2.


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?

libgit2 member

@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 ?


Isn't this already implemented: ? (In the current vNext that is)

I guess this gets closed after it's released?

libgit2 member

@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.

libgit2 member

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

@nulltoken nulltoken closed this Jan 8, 2013
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.