Okay I got Github for Windows, cloned the release version of UE4 source code, ran Setup.bat, and then ran GenerateProjectFiles.bat, which gave this error:
Setting up Unreal Engine 4 project files…
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin
\Microsoft.Common.CurrentVersion.targets(1179,5): error MSB3644: The reference
assemblies for framework “.NETFramework,Version=v4.6.2” were not found. To reso
lve this, install the SDK or Targeting Pack for this framework version or retar
get your application to a version of the framework for which you have the SDK o
r Targeting Pack installed. Note that assemblies will be resolved from the Glob
al Assembly Cache (GAC) and will be used in place of reference assemblies. Ther
efore your assembly may not be correctly targeted for the framework you intend.
[C:\UnrealEngine-4.22.3\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool
.csproj]
GenerateProjectFiles ERROR: UnrealBuildTool failed to compile.
Press any key to continue . . .