Incase anyone is interested, I’ve managed to slim down the engine size on disk a lot. I’ve optimised it for Win32/Win64, but you can theoretically remove the excludes and ignores for the platform you want to use.
Setup.bat command line
Setup.bat -exclude=WinRT -exclude=Mac -exclude=MacOS -exclude=MacOSX -exclude=osx -exclude=osx64 -exclude=osx32 -exclude=Android -exclude=IOS -exclude=TVOS -exclude=Linux -exclude=Linux32 -exclude=Linux64 -exclude=linux_x64 -exclude=HTML5 -exclude=PS4 -exclude=XboxOne -exclude=Switch -exclude=Dingo
.gitdepsignore file, sorted by: Documentations, Samples/Examples, TVOS, Mac, Linux, Android, IOS, HTML5
/Engine/Documentation/**
/Engine/Extras/ThirdPartyNotUE/GNU_Make/make-3.81/src/make/3.81/make-3.81-src/doc/**
/Engine/Extras/ThirdPartyNotUE/emsdk/emscripten/1.37.19/docs/**
/Engine/Extras/ThirdPartyNotUE/emsdk/emscripten/1.37.19/site/**
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/openexr/Contrib/Photoshop/doc/**
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/openexr/OpenEXR/doc/**
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/openexr/OpenEXR_Viewers/doc/**
/Engine/Source/ThirdParty/AMD/AMD_AGS/doc/**
/Engine/Source/ThirdParty/Expat/expat-2.2.0/doc/**
/Engine/Source/ThirdParty/HarfBuzz/harfbuzz-1.2.4/docs/**
/Engine/Source/ThirdParty/IntelTBB/IntelTBB-4.4u3/doc/**
/Engine/Source/ThirdParty/MCPP/mcpp-2.7.2/doc-jp/**
/Engine/Source/ThirdParty/MCPP/mcpp-2.7.2/doc/**
/Engine/Source/ThirdParty/PLCrashReporter/plcrashreporter-master-5ae3b0a/Documentation/**
/Engine/Source/ThirdParty/PhysX/NvCloth/docs/**
/Engine/Source/ThirdParty/PhysX/PhysX_3.4/Documentation/**
/Engine/Source/ThirdParty/PhysX/PxShared/src/foundation/doc/**
/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/debian/docs/**
/Engine/Source/ThirdParty/SDL2/SDL-gui-backend/docs/**
/Engine/Source/ThirdParty/Vorbis/libvorbis-1.3.2/doc/**
/Engine/Source/ThirdParty/libOpus/opus-1.0.3/doc/**
/Engine/Source/ThirdParty/libOpus/opus-1.1/doc/**
/Samples/**
/Engine/Extras/Maya_AnimationRiggingTools/ARTv1/MayaTools/General/ART/Projects/Sample/**
/Engine/Extras/Maya_AnimationRiggingTools/ArtToolsOSX/MayaTools/General/ART/Projects/Sample/**
/Engine/Extras/Maya_AnimationRiggingTools/MayaTools/General/ART/Projects/Sample/**
/Engine/Plugins/Online/OnlineSubsystemGoogle/Source/ThirdParty/IOS/Sample/**
/Engine/Source/ThirdParty/Facebook/IOS/Samples/**
/Engine/Source/ThirdParty/FakeIt/2.0.2/samples/**
/Engine/Source/ThirdParty/ICU/icu4c-53_1/source/samples/**
/Engine/Source/ThirdParty/PhysX/PxShared/src/foundation/samples/**
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/hdf5/c++/examples/**
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/hdf5/examples/**
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/hdf5/fortran/examples/**
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/hdf5/hl/c++/examples/**
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/hdf5/hl/examples/**
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/hdf5/hl/fortran/examples/**
/Engine/Plugins/Experimental/AlembicImporter/Source/ThirdParty/Alembic/openexr/OpenEXR/IlmImfExamples/**
/Engine/Source/ThirdParty/DotNetZip/Help/**
/Engine/Source/ThirdParty/DotNetZip/Examples/**
/Engine/Source/ThirdParty/IntelTBB/IntelTBB-4.4u3/examples/**
/Engine/Source/ThirdParty/zlib/zlib-1.2.5/Src/examples/**
/Engine/Build/TVOS/**
/Engine/Source/Programs/AutomationTool/TVOS/**
/Engine/Source/ThirdParty/ICU/icu4c-53_1/TVOS/**
/Engine/Source/ThirdParty/zlib/zlib-1.2.5/Src/contrib/TVOS/**
/Engine/Binaries/Mac/**
/Engine/Binaries/ThirdParty/ARM/Mac/**
/Engine/Binaries/ThirdParty/CEF3/Mac/**
/Engine/Binaries/ThirdParty/GoogleInstantPreview/Mac/**
/Engine/Binaries/ThirdParty/Mono/Mac/**
/Engine/Binaries/ThirdParty/PhysX/Mac/**
/Engine/Binaries/ThirdParty/libsndfile/Mac/**
/Engine/Binaries/ThirdParty/svn/Mac/**
/Engine/Build/Mac/**
/Engine/Extras/AndroidWorks/Mac/**
/Engine/Extras/ThirdPartyNotUE/emsdk/Mac/**
/Engine/Source/Programs/AutomationTool/Mac/**
/Engine/Source/Programs/Mac/**
/Engine/Source/ThirdParty/FreeType2/FreeType2-2.4.12/Builds/mac/**
/Engine/Source/ThirdParty/FreeType2/FreeType2-2.6/Builds/mac/**
/Engine/Source/ThirdParty/GoogleInstantPreview/Mac/**
/Engine/Source/ThirdParty/GoogleVR/lib/mac/**
/Engine/Source/ThirdParty/HarfBuzz/harfbuzz-1.2.4/Mac/**
/Engine/Source/ThirdParty/ICU/icu4c-53_1/Mac/**
/Engine/Source/ThirdParty/IntelEmbree/Embree2140/MacOSX/**
/Engine/Source/ThirdParty/IntelEmbree/Embree2140/src/scripts/install_macosx/**
/Engine/Source/ThirdParty/IntelEmbree/Embree270/MacOSX/**
/Engine/Source/ThirdParty/IntelEmbree/Embree270/src/scripts/install_macosx/**
/Engine/Source/ThirdParty/IntelISPCTexComp/ISPC Texture Compressor/ispc_osx/**
/Engine/Source/ThirdParty/libOpus/opus-1.0.3/Mac/**
/Engine/Source/ThirdParty/libOpus/opus-1.1/Mac/**
/Engine/Source/ThirdParty/libcurl/7_48_0/lib/Mac/**
/Engine/Source/ThirdParty/nvTextureTools/nvTextureTools-2.0.8/lib/Mac/**
/Engine/Source/ThirdParty/PLCrashReporter/plcrashreporter-master-5ae3b0a/Mac/**
/Engine/Source/ThirdParty/PLCrashReporter/plcrashreporter-master-5ae3b0a/Tools/google-toolbox-for-mac-trunk-r582/**
/Engine/Source/ThirdParty/SpeedTree/SpeedTreeSDK-v7.0/Source/Core/MacOSX/**
/Engine/Source/ThirdParty/Vorbis/libvorbis-1.3.2/macos/**
/Engine/Source/ThirdParty/Vorbis/libvorbis-1.3.2/macosx/**
/Engine/Binaries/ThirdParty/IntelISPCTexComp/Mac64-Release/**
/Engine/Source/ThirdParty/CEF3/cef_binary_3.3071.1611.g4a19305_macosx64/**
/Engine/Binaries/ThirdParty/OpenVR/OpenVRv1_0_10/osx32/**
/Engine/Binaries/ThirdParty/OpenVR/OpenVRv1_0_9/osx32/**
/Engine/Binaries/ThirdParty/OpenVR/OpenVRv1_0_10/osx64/**
/Engine/Binaries/ThirdParty/OpenVR/OpenVRv1_0_9/osx64/**
/Engine/Binaries/Linux/**
/Engine/Source/Programs/AutomationTool/Linux/**
/Engine/Binaries/ThirdParty/CEF3/Linux/**
/Engine/Binaries/ThirdParty/OpenAL/Linux/**
/Engine/Binaries/ThirdParty/Qualcomm/Linux/**
/Engine/Extras/ThirdPartyNotUE/emsdk/Linux/**
/Engine/Source/ThirdParty/FreeType2/FreeType2-2.4.12/Builds/Linux/**
/Engine/Source/ThirdParty/ICU/icu4c-53_1/Linux/**
/Engine/Source/ThirdParty/IntelEmbree/Embree2140/src/scripts/install_linux/**
/Engine/Source/ThirdParty/IntelEmbree/Embree270/src/scripts/install_linux/**
/Engine/Source/ThirdParty/IntelISPCTexComp/ISPC Texture Compressor/ispc_linux/**
/Engine/Source/ThirdParty/Linux/**
/Engine/Source/ThirdParty/Vorbis/libvorbis-1.3.2/lib/Linux/**
/Engine/Source/ThirdParty/Vulkan/Linux/**
/Engine/Source/ThirdParty/WebRTC/sdk_trunk_linux/**
/Engine/Source/ThirdParty/elftoolchain/build/Linux/**
/Engine/Source/ThirdParty/libOpus/opus-1.0.3/Linux/**
/Engine/Source/ThirdParty/libOpus/opus-1.1/Linux/**
/Engine/Source/ThirdParty/libcurl/7_48_0/lib/Linux/**
/Engine/Source/ThirdParty/libcurl/build/Linux/**
/Engine/Source/ThirdParty/nvTextureTools/nvTextureTools-2.0.8/lib/Linux/**
/Engine/Binaries/ThirdParty/ARM/Linux32/**
/Engine/Binaries/ThirdParty/OpenVR/OpenVRv1_0_10/linux32/**
/Engine/Binaries/ThirdParty/OpenVR/OpenVRv1_0_9/linux32/**
/Engine/Binaries/ThirdParty/IntelISPCTexComp/Linux64-Release/**
/Engine/Binaries/ThirdParty/OpenVR/OpenVRv1_0_10/linux64/**
/Engine/Binaries/ThirdParty/OpenVR/OpenVRv1_0_9/linux64/**
/Engine/Source/ThirdParty/CEF3/cef_binary_3.2623.1395.g3034273_linux64/**
/Engine/Build/Android/**
/Engine/Extras/AndroidWorks/Linux/**
/Engine/Extras/AndroidWorks/Win64/**
/Engine/Source/Programs/AutomationTool/Android/**
/Engine/Source/ThirdParty/Android/**
/Engine/Source/ThirdParty/GooglePlay/gpg-cpp-sdk.v2.3/gpg-cpp-sdk/android/**
/Engine/Source/ThirdParty/GoogleVR/lib/android/**
/Engine/Source/ThirdParty/HarfBuzz/harfbuzz-1.2.4/Android/**
/Engine/Source/ThirdParty/ICU/icu4c-53_1/Android/**
/Engine/Source/ThirdParty/Vorbis/libvorbis-1.3.2/lib/Android/**
/Engine/Source/ThirdParty/libOpus/opus-1.1/Android/**
/Engine/Source/ThirdParty/libcurl/build/Android/**
/Engine/Binaries/DotNET/IOS/**
/Engine/Build/IOS/**
/Engine/Source/Programs/IOS/**
/Engine/Source/Programs/AutomationTool/IOS/**
/Engine/Source/ThirdParty/Facebook/IOS/**
/Engine/Source/ThirdParty/FreeType2/FreeType2-2.4.12/Builds/IOS/**
/Engine/Source/ThirdParty/GoogleVR/lib/ios/**
/Engine/Source/ThirdParty/HarfBuzz/harfbuzz-1.2.4/IOS/**
/Engine/Source/ThirdParty/ICU/icu4c-53_1/IOS/**
/Engine/Source/ThirdParty/PLCrashReporter/plcrashreporter-master-5ae3b0a/IOS/**
/Engine/Source/ThirdParty/libPNG/libPNG-1.5.2/projects/IOS/**
/Engine/Build/HTML5/**
/Engine/Source/Programs/HTML5/**
/Engine/Source/Programs/AutomationTool/HTML5/**
/Engine/Source/ThirdParty/HarfBuzz/harfbuzz-1.2.4/HTML5/**
/Engine/Source/ThirdParty/ICU/icu4c-53_1/HTML5/**
/Engine/Source/ThirdParty/SDL2/HTML5/**
/Engine/Source/ThirdParty/Vorbis/libvorbis-1.3.2/lib/HTML5/**
/Engine/Source/ThirdParty/Vorbis/libvorbis-1.3.2/lib/HTML5Win32/**
- In TargetPlatform.Build.cs: commented out all ‘DynamicallyLoadedModuleNames.Add(“…”);’ that deal with platforms I don’t want, like “AndroidTargetPlatform”.
- In UnrealBuildTool.cs: changed the ‘static public UnrealTargetPlatform] AllPlatforms’ array to contain only the platforms I want.
- In the AllDesktop.Automation.cs: commented out the Mac and Linux enum’s from the “GetStagePlatforms()” ovveride function.
- In each Automation project, added a “public override bool CanBeCompiled() { return false; }” to the platforms I don’t want.
- Disabled UE4.sln projects: DsymExporter (Mac), ShaderCacheTool (Mac), UE4EditorServies (Mac), UnrealAtoS (Mac), UnrealLaunchDaemon (IOS)
Also when cloning/fetching the git repo, I only cloned the branch I wanted instead of all, and used --depth 1 to only get the latest history, this also saves alot of disk space.