It is seems that Repository.checkout can only checkout a referenece.
Can we checkout any revision in the repo by SHA1-hash?
equivalent to "svn checkout -r" in subversion system
Asked
Active
Viewed 701 times
0

Zoe
- 27,060
- 21
- 118
- 148

user3196254
- 115
- 1
- 6
1 Answers
0
The Repository.checkout()
method does only accept references or reference names, but that's by far not the only checkout method. There's Repository.checkout_tree()
which lets you specify which treeish you want to check out (so you can pass a tree, a commit or a tag).

Carlos Martín Nieto
- 5,207
- 1
- 15
- 16
-
Note however that it does not detach HEAD like `git checkout
` would do – Jakub Narębski Dec 01 '17 at 18:44