# Building Git From Source
You may want to build git from source if, for example, `apt` does not contain the latest version and you need it.
Several dependencies are needed for compilation to work. I've identified the ones listed here:
`sudo apt-get install libssl-dev libcurl4-nss-dev gettext`
These steps work for Raspbian and Debian 11.
1. `wget https://github.com/git/git/archive/refs/tags/v2.38.1.zip`
- Replace the version with the one you want
2. `sudo unzip v2.38.1.zip`
3. `cd git-2.38.1/`
4. `sudo make prefix=/usr/local all`
- This may take some time. Get coffee. If you get the following errors you're missing dependencies
- `git-compat-util.h:364:10: fatal error: openssl/ssl.h: No such file or directory`
- `libssl-dev` is missing
- `git-curl-compat.h:3:10: fatal error: curl/curl.h: No such file or directory`
- `libcurl4-nss-dev` is missing
- `tclsh failed; using unoptimized loading MSGFMT po/bg.msg make[1]: *** [Makefile:254: po/bg.msg] Error 127`
- `gettext` is missing
5. `sudo make prefix=/usr/local install`
## Sources
- [How to Install Git on Debian 11 Bullseye](https://www.linuxcapable.com/how-to-install-configure-git-on-debian-11/)