Advice to NOT checkout the tagged release:
For most users it is usually better to compile from the HEAD of the release branch instead of compiling the exact release like 21.02.0
Checking out the exact release locks also the feeds (packages, LuCI etc..) to the commits at the release moment. Later fixes made to LuCI and other packages will not get compiled into the firmware. Similarly fixes made later to the 21.02 branch main OpenWrt sources do not get included. (see the locked feeds at https://github.com/openwrt/openwrt/commit/b2ae4233149dfd78f2ac00bb5327695bcacdc255 )
When compiling from the release branch HEAD, the later fixes into the main 21.02 OpenWrt source and into the package feeds get included in the build. To achieve that, do not checkout the release tag "v21.02.0" but checkout the branch "openwrt-21.02":
git checkout openwrt-21.02
Old advice for checking out the tagged release:
I am sure that sooner or later there will be a flood of questions how to checkout the exact release source code for a tagged release (like 17.01.0-rc1), so this is a short guide:
You need to have already cloned the LEDE source repo in advance with
git clone https://git.lede-project.org/source.git
Then you only fetch the tags and checkout the correct one:
git fetch --tags
git checkout v17.01.0-rc1
Example workflow how to fetch v17.01.0-rc1 source:
perus@ub1610:/r7800-lede1701$ git fetch --tags
remote: Counting objects: 19, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 19 (delta 13), reused 0 (delta 0)
Unpacking objects: 100% (19/19), done.
From https://git.lede-project.org/source
31b0640906..e038c60049 lede-17.01 -> origin/lede-17.01
* [new tag] v17.01.0-rc1 -> v17.01.0-rc1
perus@ub1610:/r7800-lede1701$ git tag -l
reboot
v17.01.0-rc1
perus@ub1610:/r7800-lede1701$ git checkout v17.01.0-rc1
A files/etc/Compile_info.txt
A files/etc/applyHNsettings.sh
...
M target/linux/ipq806x/base-files/etc/board.d/01_leds
Note: checking out 'v17.01.0-rc1'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 68a04dbb42... LEDE v17.01.0-rc1: adjust config defaults
Below is verification that the main source code is at the release tag and that all feeds point to a specific commit instead of the moving HEAD of the respective lede-17.01 branch in that feed:
perus@ub1610:/r7800-lede1701$ git log --oneline | head -n 5
68a04dbb42 LEDE v17.01.0-rc1: adjust config defaults
ec095b5bf3 ledtrig-netdev: don't cancel work on events for different interfaces
b8fcbbf31d kmod-sched-core: Add HTB and TBF traffic shapers
70a6bbd53d ar71xx: prepare jffs2 partition properly in factory.bin for BHR-4GRV2
f5e8c908bd mxs: remove stale references to obsolete kernel module packages
perus@ub1610:/r7800-lede1701$ cat feeds.conf.default
src-git packages https://git.lede-project.org/feed/packages.git^31d89be9e69bac261bfe7440512cb4e0f3356255
src-git luci https://git.lede-project.org/project/luci.git^472dc4b9e2ca71c114f5da70cb612c1089b8daa7
src-git routing https://git.lede-project.org/feed/routing.git^a6c7413594a0e4b42dab42bb5fa68534e39b7d0c
src-git telephony https://git.lede-project.org/feed/telephony.git^1f0fb2538ba6fc306198fe2a9a4b976d63adb304