Git Bash is a terminal emulator for Windows, used to experience the Git command line. With Git Bash, you can work on any code changes on the terminal itself, without the need for another coding environment, such as Atom, Notepad++, etc. Follow the various methods in this guide to install Git and Git Bash on Windows. When you add Git Bash as a program to Windows, it installs the entire Git version control system.
How to Install Git Bash/Git on Windows
There are four different ways to install Git Bash/Git on Windows, each with its own advantages. The first method is the full instructions for the regular Git installer, while the others are shortcuts to the same results.
1. Using Git Installer on Windows
longer install Git for Windows It's easy, but you should carefully check the steps to avoid sync errors later.
- Click Windows Link in download page.
- You'll see multiple download links. If you're looking for the regular installer, choose the latest 64-bit version for Windows.
- Accept GNU General Public License.
- Locate Destination location on your Windows device.
- Select the components you want to install and remove the components you don't want to install. At a minimum, you'll need to enable the options. Git Bash و Git GUI و Git LFS (Large File Support) و “Associating .git configuration files with the default text editor” و “Associate .sh files to be run with Bash.” In most cases, these required options should be enabled by default.
- will be Create a Git folder As the default folder in Program Files. You can choose not to create a Start menu folder.
Customize your installation
In the next step, you will have the option to choose the default editor by Git.
- While Vim It is the default editor, you will find many other options, such as: Notepad ++ and Atom Visual Studio Code and Sublime Text. In this tutorial, we're using Vim.
- Specify the name of the initial branch or leave it to Git. It is safer to specify “Let Git decide.”
- Locate PATH environment Recommended for Git from the command line and also from third-party programs.
- Locate Using OpenSSH bundled As a secure shell (SSH) executable client.
- Select the backend for HTTPS transfer, Using the OpenSSL library For superior authentication.
- Another Git convention is to configure line endings in text files. Specify “Windows-style Checkout, adhere to Unix-style line endings.”
- You need a terminal emulator to use Git Bash with it. Choose MinTTY, the default terminal for MSYS2, instead of the Windows console window. This keeps Git programs separate from what you're doing in the command prompt.
- Select the option "hypothetical" For behavior requests “git pull”.
- to manage GitHub and other third-party credentials, select Git Credential Manager.
Additional options
There are also some additional options that you need to configure in a regular installation of Git for Windows.
- Locate Enable file system caching To improve performance.
- It's safe to ignore experimental options, such as fake controllers.
- Installing Git will take a few minutes.
- You can run Git Bash after the Git setup wizard finishes.
- Alternatively, locate the Git Bash application in Windows search or open the executable file from the folder where it is installed.
- The MinTTY terminal emulator should be visible. This will help you keep Git processes separate from other computer functions. The MinTTY window looks like a command terminal.
2. Use the portable version of Git
Aside from the long regular installer, Git also has a portable version for Windows, which is very easy to use.
- Go to Git Download Page for Windows Click on the download link. Windows Portable.
- Save .ZIP file Mobile in a folder of your choice.
- You can change the Git portable installation destination by clicking Three dots icon.
- Wait until the portable installer is fully extracted.
- Once the process is complete, you will find the portable folder nested inside “Git Bash Install Windows”.
- turn on Git Bash application From a volume PortableGit , then save it to a USB drive, if you like.
- MinTTY describes itself as a portable terminal, but it's no different from a regular terminal, and you can use all Git commands here.
3. Using WinGet tool
You can use the Winget command line tool to install Git/Git Bash on Windows.
- Install an app App Installer Microsoft Store on your computer.
- Open command prompt in administrator mode.
- Type winget to verify that the App Installer installed correctly. It will display several commands you can use with winget.
- Install Git using Winget in the command prompt by typing the following code:
winget install --id Git. Git -e --source winget
- Installing Git via WinGet in the command prompt may take up to a minute. You may also see an installer pop-up.
- Check if a message appears “Installed successfully” at the command prompt.
- Once the Git setup wizard finishes installing Git, launch Git Bash or open the program terminal from the Windows search box in administrator mode.
It is useful to know: Is Windows 11 tools not working for youTry these solutions.
4. Chocolatey
Chocolatey is a Windows PowerShell application that can quickly install the full version of Git/Git Bash. It acts as a wrapper for any target application that is installed.
- Open PowerShell in Administrator mode.
- install Chocolate and In Windows, use the following command. You won't receive any message confirming the successful installation. Once the process is complete, close the PowerShell window and then restart.
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
- in PowerShell window New (administrator mode), type the following to install Git using Chocolatey.
choco install git.install
- Click "TO" Or "Y" To grant the permissions requested by Chocolatey.
- Once Git install On your device, you will see a success message. PowerShell window.
Good to know: Do you want to know? How to use PowerShellYou will need this list of basic commands.
Frequently Asked Questions
Q1: What is the difference between Git and GitHub?
The answer: Git is an open source version control system whose repositories are hosted on GitHub, an online collection of Git source code. GitHub is owned by Microsoft; however, its open source nature remains unchanged by this ownership. While you need Git to run many GitHub projects, the opposite is true: alternatives to GitHub exist, such as GitBucket, GitLab, and SourceForge.
Q2: What is the difference between Git and Git Bash?
The answer: Git is the original Unix-based version control system, launched in 2005 by Linus Torvalds to track code changes in multi-user collaborative projects on Linux and Mac. Bash is another Linux-specific command-line shell based on Unix.
Microsoft's operating system was not originally designed for Bash, a Linux-based command-line system. Therefore, Windows users must install Git Bash, a third-party program that is a dedicated terminal emulator designed specifically for Windows. With Git Bash, you can run both Git and Bash together in Windows.
Q3: Is it possible to completely uninstall Git from Windows?
The answer: You can completely uninstall Git from Windows by uninstalling the Git Bash application from "Add or Remove Programs" in Settings, or by going to the Control Panel and clicking "Uninstall a program" under Programs and Features. Locate the Git folder in the C:\ drive using the Windows search menu, and then delete it. If you're using the portable version of Git on Windows, delete the Git folder, as no other installation has been performed.