Building Git 2.0.0 from sources on Windows
Interested in binaries? Git 2.0.0 build can be fetched from my Github repo https://github.com/madhur/msysgit-2.0.0 Note that I have not tested it thoroughly myself. If you face any issues, do bring it to my notice but I am in no way responsible for it. Use it at your own risk.
Git 2.0.0 just released few days back.
As of this writing, MsysGit for Windows has latest version 1.9.2 available for download.
Eager to try out this new version, I decided to build it myself.
- Download MysysGit build environment for Windows from here - https://github.com/msysgit/msysgit
Place it in a directory such as C:\gitbuild
- Download Git 2.0.0 sources from here - https://github.com/msysgit/git
Copy this entire source into the git
directory in C:\gitbuild\git
Note: Actually, the git repository in the first step has a submodule pointing to the second repository in
C:\gitbuild\git
. If you are familiar with Git > submodules, you can download via submodule command as well.
- Execute
msys.bat
fromC:\gitbuild\
. You should be now in bash console as follows:
Note: In some envrionments, the build process should automatically begin after executing msys.bat. If it doesn’t go to the next step.
cd
toC:\gitbuild\git
and executemake
command. The build process should now begin:
Once the build is complete, you may exit the bash shell.
- The build process automatically places the git binaries in
C:\gitbuild\bin
. To confirm you have successfully built,cd
toC:\gitbuild\bin
and executegit.exe
-
Congratulations you have just built Git 2.0.0 from sources. However, there are some quirks and tweaks required to be corrected, which we cover in next steps.
-
git gui
command throws an error as follows:
The reason of error is because git gui
depends on Tcl/Tl 8.5.13
package. I just copied the following files and folders from my old build and it works fine.
git\lib\tcl8
git\lib\tcl8.5
git\lib\tk8.5
git\lib\tclConfig.sh
git\lib\tkConfig.sh
git\bin\wish.exe
git\bin\wish85.exe
git\bin\tcl85.dll
git\bin\tclpip85.dll
git\bin\tclsh.exe
git\bin\tclsh85.exe
git\bin\tk85.exe
After copying these files, git gui
should work fine.
- At this point, you have working version of Git 2.0.0 and you can remove the sources if you want.
If you get the error
fatal: unable to access '.....git/': SSL certificate problem: unable to get local issuer certificate
, you may have to put this line in your .gitconfig. Replaced
with your drive letter.
- You can also place your ssh private and public key in the
.ssh
folder inC:\gitbuild
in order to work with Github