How to update sourse version Engine from GITHUB?

My current approach is to delete the compiled engine, download it from GitHub again, and then rebuild the new version of the engine. Because I don’t know which method is safe and effective. However, each time a new version of the source code engine is deployed, it needs to use bat files to download a large amount of data, which has a great burden on SSD. Is there any way to update only to a new release branch, and to verify the integrity of the file, and download it automatically when a new file is found or an existing file is found to be modified?