Git is similar to other pieces of open source software. Just configure it, type make, and install it. Small matter of software, right? Perhaps.
If your system has the proper libraries and a robust build environment and you do not need to customize Git, building the code can be a snap. On the other hand, if your machine lacks a compiler or a suite of server and software development libraries, or if you’ve never built a complex application from source, consider building Git from scratch only as a last resort. Git is highly configurable, and building it shouldn’t be taken lightly.
To continue the build, consult the INSTALL file in the Git source bundle. The file lists several external dependencies, including the zlib, openssl, and libcurl libraries.
Some of the requisite libraries and packages are a bit obscure or belong to larger packages. Here are three tips for a Debian stable distribution:
curl-config, a small tool to extract information about the local curl install, can be found in the libcurl3-openssl-dev package.
The header file expat.h comes from the libexpat1-dev package.
The msgfmt utility belongs to the gettext package.
Because compiling from sources is considered “development” work, the normal binary versions of installed libraries are not sufficient. Instead, you need the -dev versions because the development variants also supply header files required during compilation.
If you are unable to locate some of these packages or cannot find a necessary library ...