-
More a general Q/A than an issue, but I'm struggling with this topic. I clone a repository using I found the following solution, but it resets HEAD of my master branch, which is not what I want:
Is it possible to perform something like a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
That's quite alright, the issue was tagged accordingly. Thanks. That's a great finding! I did do some searching to come up with the following.
I hope this answers the question - GitPython is a lot of 'low-level' plumbing, which makes some common operations unintuitive. These are best left to the git porcelain, provided by the Even though I am closing the issue, please feel free to keep posting follow-ups. |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for the reply. Your solution does exactly what I expected, and I was pretty sure that there is a possibility :-) Thanks! |
Beta Was this translation helpful? Give feedback.
That's quite alright, the issue was tagged accordingly. Thanks.
That's a great finding! I did do some searching to come up with the following.
HEAD
to point to the tag:repo.head.set_reference(repo.tags[tag].commit
repo.git.checkout(tag)
which does exactly what you want.I hope this answers the question - GitPython is a lot of 'low-level' plumbing, which makes some common operations unintuitive. These are best left to the git porcelain, provided by the
git
command-line interface.Even though I am closing the issue, please feel free to keep posting follow-ups.