Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upClone repository and “checkout” to "tags/<my_tag>" #1026
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. |
Thanks a lot for the reply. Your solution does exactly what I expected, and I was pretty sure that there is a possibility :-) Thanks! |
More a general Q/A than an issue, but I'm struggling with this topic.
I clone a repository using
Repo.clone_from()
. Afterwards, I simply want to switch to a specified tag within the repository, similar togit checkout tags/<my_tag>
.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
git checkout tags/<my_tag>
where I just switch to the current tag, but am able to switch also back to the current / latest commit on the repository?