devguide icon indicating copy to clipboard operation
devguide copied to clipboard

Add info on how to checkout earlier versions pre-GitHub migrations

Open Mariatta opened this issue 5 years ago • 2 comments

It would be great if Git Bootcamp has information on how to checkout git tags to get the earlier CPython releases (e.g. 3.3, 3.4 )

3.3. and 3.4 aren't on CPython's GitHub as branches (unlike 3.7, 3.8, etc), but there are git tags, can can be checked out as follows:

# list all git tags matching v.3.3
git tag -l 'v3.3*'

# checkout the v.3.3.0 tag to a local branch
git checkout tags/v.3.3.0 -b my-own-3.3.0-branch

Mariatta avatar Feb 12 '20 00:02 Mariatta

It's a bit simpler than that. You don't need to specify tags/ when referencing tags.

git checkout v3.3.0           # for detached head state
git checkout v3.3.0 -b v3.3.0 # to also create a local branch

https://git-scm.com/book/en/v2/Git-Basics-Tagging

ned-deily avatar Feb 12 '20 01:02 ned-deily

We've also kept tags for old branches with the same name as the branch (for example, 3.2, 3.3, etc.), though ~~that tag doesn't seem to have been created for 3.4~~ it seems an explicit git fetch --tags upstream may be necessary to get them all. With those tags, there's no difference to checking out an active branch, with the exception that you'll be on a "detached HEAD" if you don't create your own branch.

zware avatar Feb 12 '20 02:02 zware