Go to https://git-scm.com and select Download. This will download something like Git-<version>-64-bit.exe. Double click Git-<version>-64-bit.exe. At Information, select Next.
At Select Destination Location, select your preferred destination, and select Next.
At Select Components, select your preferred components, and select Next.
At Select Start Menu Folder, type the name that you want to appear in the start menu, and select Next.
At Choosing the default editor used by Git, I like Notepad++. You would need to already have Notepad++ installed on your PC. Select Next.
At Adjusting your PATH environment, select your preferred option and select Next.
At Choosing the SSH executable, check Use OpenSSH and select Next.
At Choosing HTTPS transport backend, check Use the OpenSSL library and select Next.
At Configuring the line ending converation, check Checkout Windows-style, commit Unix-style line endings and select Next.
At Configuring the terminal emulator to use with Git Bash, check Use MinTTY and select Next.
At Configuring extra options, check Enable file system caching and Enable Git Credential Manager and select Install.
At Completing the Git Setup Wizard, select Next.
To validate that Git was successfully installed, issue the git --version command.
git --version . . . git version 2.26.2
$ cd C:/Users/john.doe/Sample
In this example, the hidden .git folder is located at C:\Users\john.doe\Sample\.git.