Quick Installation
Choose your operating system to get started:Linux
Use your distribution’s package manager
macOS
Install via Homebrew or Xcode tools
Windows
Download the official installer
Installation by Platform
macOS
macOS
Windows
Windows
Official Git for Windows
- Download the installer from git-scm.com/download/win
- Run the installer with default options
- Git Bash will be available from the Start menu
Using Chocolatey
Using Winget
Building from Source
For the latest features or if you want to contribute to Git development, you can build from source.Prerequisites
Git requires these dependencies:Essential Dependencies
Required for all builds:
- zlib - Compression library (Git won’t build without it)
- gcc or another C compiler
- make - Build tool
Optional but Recommended
- libcurl (version 7.61.0+) - For HTTP/HTTPS operations
- expat - For git-http-push
- Perl (version 5.26.0+) - For git-send-email, git-svn
- Python (version 2.7+) - For git-p4
- ssh - For remote operations
Standard Build
The most common installation method:The
prefix determines where Git will be installed. Common values are /usr, /usr/local, or your home directory. If you change the prefix between make all and make install, the installation will fail because paths are encoded during the build.Build Configuration
You can customize the build by:-
Command line variables:
-
config.mak file:
Common Build Options
Common Build Options
NO_CURL=YesPlease- Build without HTTP/HTTPS supportNO_EXPAT=YesPlease- Build without git-http-pushNO_PERL=YesPlease- Build without Perl scriptsNO_PYTHON=YesPlease- Build without Python scriptsNO_TCLTK=YesPlease- Build without gitk and git-guiNO_GETTEXT=YesPlease- Disable localization (English only)
Profile-Optimized Build
For better performance (useful for distribution packagers):Testing Before Installing
You can test Git without installing it:Running from bin-wrappers is less efficient than an installed Git because it requires an extra fork+exec for every Git subcommand.
Verify Installation
After installation, verify Git is working:Initial Configuration
Before using Git, set your identity:Platform-Specific Notes
Perl Library Path
On some Linux distributions, Perl libraries may not be installed where you expect:Name Conflicts
Troubleshooting
Command not found after installation
Command not found after installation
The git binary may not be in your PATH. Check your installation location and add it:
Build fails with missing dependencies
Build fails with missing dependencies
Install the required development packages for your distribution. Check the error message to identify which library is missing, then install the corresponding
-dev or -devel package.Permission denied during make install
Permission denied during make install
If installing to system directories like
/usr, you need root privileges:Next Steps
Now that Git is installed, you’re ready to start using it:Quick Start
Make your first commit in minutes
Tutorial
Learn Git fundamentals step by step
