You can simply use winget which is a command-line tool for managing software packages on Windows 10 and 11, introduced by Ms as part of the Windows Package Manager. winget is included by default starting from Windows 10 version 1809 (build 17763) and in Windows 11. It's part of the App Installer package available from the Microsoft Store.
Open powershell as administrator copy/paste the below command
winget install --id Git.Git -e --source winget
This command will automatically download and install the latest version of Git. Follow any on-screen prompts to complete the installation.