Template:Build Documentation Choose Version
Git checkout, which version (or git branch) you want to build.
In case you want to build a specific git tag.
git checkout 18.104.22.168.1-stable
You have to replace 22.214.171.124.1 with the actual version you want to build. The stable version, the testers-only version or the developers version. Common sense is required while choosing the right version number. For example, the biggest version number is not necessarily the most recommended / latest stable version. You can learn about current versions reading Whonix News Blogs. New versions are also announced on the whonix-devel mailing list. So you could alternatively check its archives. Signing up for whonix-devel is another way to get informed about new releases.
Clean up and Sanitize
This is also important for security.
Get a list of eventually extraneous files and folders. 
git clean -ndff
And look if that looks sane. (Generally should, unless you are modifying Whonix's source code, then you should understand git a bit better and know what you are doing.) If it looks like the following, everything is fine.
Would remove packages/apparmor-profile-gwenview/ Would remove packages/kde-privacy/
Now get rid of these folders.
git clean -dff
Removing packages/apparmor-profile-gwenview/ Removing packages/kde-privacy/
Make sure you have checked out the right commit for each git submodule.
git submodule update --init --recursive
Check if there are no extraneous files. This is important for security.
Should only show and nothing else.
# Not currently on any branch. nothing to commit (working directory clean)Otherwise we'd need to get rid of these files first.