NEW COURSE • 100% FREE

Foundations Of AI For Software Development

Enroll To Get Started →
OFERTA DÍA DE MUERTOSAHORRA HASTA 70%Oferta Por Tiempo LimitadoComprar ahora

Git Blog

Releasing the Power of Git

What Is Git Bash? How to Install and Use It on Windows

This article was written by a guest author.

Updated: 11/09/2026

Git Bash is a Bash shell for Windows that comes bundled with Git for Windows. It lets you run Git commands and common Unix tools like ls, grep, ssh, and cat on Windows, with the same syntax you’d use on macOS or Linux.

      • What it is: Bash plus Unix utilities, built on MSYS2, running in the Mintty terminal

      • Cost: Free and open source

      • Who it’s for: Windows developers who want Unix-style commands, or who follow tutorials written for macOS and Linux

    Git Bash also translates paths automatically between Windows format (C:\Users\name) and Unix format (/c/Users/name), so scripts written for other systems usually run without changes.

    You don’t need Git Bash to use Git on Windows, because Git also runs in CMD and PowerShell. Git Bash is the better choice when you want Bash scripts, Unix commands, or the exact syntax from a tutorial to work as written.

    As Git experience increases, end-users can prefer using Git command line features for specific commands. Git Bash is one tool that provides command line features in the Windows Operating System to end-users. Another tool that developers can use to interact with the command line on Windows is GitKraken Desktop’s CLI.

    Git Bash Topics Covered

    Introduction to Git Bash

    Git Bash Download

    How to Install Git Bash from the Command Line

    Using Git Bash with GitHub

    Git Bash Commands

    Set Git Bash as Your Default Terminal in GitKraken Desktop

    Git Bash FAQ

    “@GitKraken Client is one of the best graphical tools to keep track of your code. I used just Bash before. GitKraken Client simplified my life a lot!” – @elenaManele

    Introduction to Git Bash

    Git Bash

    A shell is a computer application that integrates with the operating system and exposes its services to an end-user or other applications. Bash is an acronym for Bourne Again Shell, which is the GNU Project’s shell.

    Git Bash is not just a bash package for Microsoft Windows OS. It includes bash utilities, Unix collections like Secure Shell Protocol (SSH), Secure Copy Protocol (SCP), CAT (Unix utility that reads files sequentially, writing them to standard output), and other Unix-based collections compiled for Windows and Git features.  

    Git Bash provides a package for Git usage from the command line for Windows users, but GitKraken Desktop will make those same actions faster and more intuitive.

    Some things absent from Git Bash that users can enjoy in GitKraken esktop are auto-suggest and auto-complete for Git commands. Just start typing a command in the terminal tab and you will see relevant command suggestions with descriptions. Simply select the command you’re looking for and hit enter to automagically complete the Git action! 

    GitKraken Desktop’s magical auto-complete and auto-suggest for Git commands will help you accelerate your keyboard-driven Git workflow and increase your productivity.

    Git Bash Download

    Git Bash can be installed as other Windows applications, but you need to first download the executable file from the Git Bash download page and then follow the installation steps.

    1. Open your favorite browser and go to the Git Bash Download page on Git-scm.

    Git Bash Download screen

    2. After successfully downloading the Git Bash executable file, follow the installation steps.

    3. Voilà! Git Bash is ready to be used on your local Microsoft Windows platform.

    *If you used the above process to download Git Bash and Git for Windows for the first time, you may find instructions for configuring Git after your Git download useful. You’ll need to configure Git before you can access all of Git’s capabilities and features.

    How to Install Git Bash from the Command Line

    Git Bash comes with Git for Windows, so installing Git for Windows from the command line installs Git Bash too. Open PowerShell or Command Prompt and use one of the package managers below.

    Install Git Bash with winget

    winget, the Windows Package Manager, is included with current versions of Windows 10 and Windows 11. Run:

    winget install --id Git.Git -e --source winget

    Install Git Bash with Chocolatey

    If you use Chocolatey, run this from an administrator PowerShell window:

    choco install git

    Check that Git Bash is installed

    Close and reopen your terminal, then run:

    git --version

    If a version number appears, Git and Git Bash are installed. Open Git Bash from the Start menu, or right-click inside a folder and choose Open Git Bash here (on Windows 11, it’s under Show more options).

    Using Git Bash with GitHub

    In this section, we will look at how to run Git Bash and see some basic Git Bash commands required for Git integration. As Git Bash is a command line utility for Git on the Microsoft Windows platform, a basic Microsoft Windows command prompt (CMD) knowledge will be useful before getting started with Git Bash as they are very similar. If you do not know how to use CMD features, you can just take a look at the Windows Commands Reference from the Microsoft related web site.

    Now, let’s look at an example of using Git Bash with GitHub. You will start by linking your GitHub account with Git Bash to start configuring your GitHub repositories. If you do not have a GitHub account, you can create one directly from the GitHub home page.

    You can also refer to GitHub Docs for a very large and illustrative documentation about GitHub usage.

    Git Bash Commands

    Before going into steps on how to configure Git Bash and how to use it, you need to have a repository on GitHub. If this is your first time creating a repository on GitHub, checkout the related GitHub documentation for instructions on how to create a repository on GitHub.

    Now, let’s start configuring Git Bash with your GitHub account from scratch (examples in this article will be given from my personal GitHub account).

    1. First step is to run Git Bash. Double click the Git Bash icon on your Windows desktop to open your Git Bash interface.

    Git Bash Screen

    2. Use the cd Git bash command to change your active directory with your local repository workspace. cd and chdir in Windows CMD are aliases for setting the active directory.

    Now your active directory is your local repository. You can validate your active directory with the pwd command.

    Changing Active Directory in Git Bash

    3. This step is related to configuring your GitHub email and GitHub username. Type the below commands to link your GitHub email & GitHub username.

    git config --global user.name "%yourGitHubUserName%"
    git config --global user.email "%yourGitHubUserEmail%

    a. Now, you can clone the “git-bash-intro” repository to your local workspace. First, get the clone link from your GitHub repository as shown below:

    Getting the Clone Link of the Repository from GitHub

    b. Then, type the below command to clone your repository. You will use the clone link that you just copied from your GitHub repository.

    git clone "%yourRepositoryCloneLink%"

    Cloning a Git repository with Git Bash

    There are two important tips while cloning the Git repository. First: if you create a private repository, you also need to have related GitHub permissions. In this Git Bash example, the git-bash-intro repository was initialized as public. You can check the repository visibility section from GitHub Docs for more information about GitHub repository permissions.

    Another helpful tip is that you may face the below error while cloning a repository:

    fatal: could not create work tree dir 'git-bash-intro': permission denied

    This error states that you do not start Git Bash with the required permission to execute changes on your local Microsoft Windows platform. You can run Git Bash as administrator to resolve.

    4. Next, you will clone a repository to your local workspace to create a folder with the same name as your GitHub repository.

    git-bash-intro Folder

    5. Add a new text file called “firstCommit.txt” in your git-bash-intro local repository.

    Adding firstCommit.txt to a local repository: git-bash-intro

    6. It is time to reflect your local changes to your remote GitHub repository. Here, you will need to run a set of commands to push changes to your remote git-bash-intro repository.

    git add .
    
    git commit -m "first commit"
    
    git push origin master

    Now, let’s check what these Git bash commands mean:

        • git add: This command adds content to the git index and updates the index with the local working tree. You can use “.” to add all working tree contents, or you can explicitly mention which content you want to add.
          For instance; you can use “git add firstCommit.txt” in order to add just `firstCommit.txt` to the index.
          For more details, you can visit the git-add documentation page on Git-scm.

          • git commit: This command creates a new commit instance with the current content(s) of the index and with the log message describing the changes.
            For more details, you can visit the Git Commit page in the GitKraken Learn Git center.

            • git push: This command updates the remote refs with the local refs. In this example, we will update the master branch in our remote repository with our local changes.
              For more details, you can visit the git-push documentation page on Git-scm.  

              • git pull: This command will pull all changes from a remote repository branch to your local repository branch.
                For more details, you can watch the beginner Git tutorial video: What is Git Pull?.   

            7. Confirm the remote repository is in the GitHub account. Sure enough, the new file “firstCommit.txt” is there!

            Checking Remote Repository after Pushing the Change

            Now that you have received this Git Bash introduction, you can easily adopt these steps to your own projects as you integrate Git Bash with your GitHub account and use the Git version control system for your code base.

            Alternatively, the process of integrating your command line terminal with Windows using GitKraken Desktop is much easier and takes far fewer steps. Simply download GitKraken Desktop on your Windows machine, open a new tab, and click New Terminal Tab. Then start typing your commands to get to work – seriously, it’s that easy!

            Using GitHub with GitKraken Desktop

            In comparison to using GitHub with Git Bash, in GitKraken Desktop, you can leverage the full power of the robust GitHub integration by simply signing into GitKraken Desktop using your GitHub credentials. From there, it’s just a few short steps to generate an SSH key and add to GitHub, and clone or fork a GitHub repository. Learn more about how developers use GitKraken Desktop with GitHub for a seamless Git workflow, including creating GitHub pull requests.

            Set Git Bash as Your Default Terminal in GitKraken Desktop

            Git Bash is a life saver for Windows users who want to leverage the power of the Git command line for their version control. It is easy to install Git Bash and start using it as stated throughout this article. 

            And even better, with GitKraken Desktop, you can combine the power of Git Bash with visualization tools—like the commit graph, diff view, file history and blame, to unlock even more productivity. 

            To use Git Bash as the default shell for GitKraken Desktop’s built in CLI, perform the following steps: 

                • Select Preferences, represented by the gear icon, from the top toolbar

                • From the left navigation, select Terminal

                • Select Default Terminal 

                • From the subsequent dropdown menu, select Git Bash 

              You’re all set! Enjoy the power of Git Bash and the convenience of powerful visualization features, combined into one luxurious tool: GitKraken Desktop.

              Select Git Bash as your default terminal in GitKraken Client

              Git Bash FAQ

              Q: How do I paste into Git Bash?

              Press Shift+Insert, or right-click and choose Paste. To copy, select text with your mouse (Git Bash copies it automatically) or press Ctrl+Insert. You can turn on Ctrl+Shift+C and Ctrl+Shift+V under Options > Keys.

              Q: How do I update Git Bash?


              Update Git for Windows by running git update-git-for-windows in Git Bash, or download the latest installer from git-scm.com.

              Q: Is Git Bash the same as Git?


              No. Git is the version control system. Git Bash is a Windows shell that comes with Git for Windows, and you can use Git without it in CMD or PowerShell.

              Q: Do I need Git Bash on Mac or Linux?


              No. macOS and Linux already include a Unix shell, so you can run Git commands in the built-in terminal.

              Q: Git Bash vs. PowerShell: which should I use?


              Use Git Bash when you need Bash scripts, Unix commands, or a tutorial’s exact syntax. Use PowerShell for Windows administration and scripts. Git works the same in both.

              GitKraken Desktop has revolutionized Git! Get a keyboard-driven, Git-enhanced terminal experience with powerful visualizations like the commit graph to help you accelerate your workflow.

              Like this post? Share it!

              Read More Articles

              This article was written by a guest author.

              Updated: 11/09/2026

              Git Bash is a Bash shell for Windows that comes bundled with Git for Windows. It lets you run Git commands and common Unix tools like ls, grep, ssh, and cat on Windows, with the same syntax you’d use on macOS or Linux.

                  • What it is: Bash plus Unix utilities, built on MSYS2, running in the Mintty terminal

                  • Cost: Free and open source

                  • Who it’s for: Windows developers who want Unix-style commands, or who follow tutorials written for macOS and Linux

                Git Bash also translates paths automatically between Windows format (C:\Users\name) and Unix format (/c/Users/name), so scripts written for other systems usually run without changes.

                You don’t need Git Bash to use Git on Windows, because Git also runs in CMD and PowerShell. Git Bash is the better choice when you want Bash scripts, Unix commands, or the exact syntax from a tutorial to work as written.

                As Git experience increases, end-users can prefer using Git command line features for specific commands. Git Bash is one tool that provides command line features in the Windows Operating System to end-users. Another tool that developers can use to interact with the command line on Windows is GitKraken Desktop’s CLI.

                Git Bash Topics Covered

                Introduction to Git Bash

                Git Bash Download

                How to Install Git Bash from the Command Line

                Using Git Bash with GitHub

                Git Bash Commands

                Set Git Bash as Your Default Terminal in GitKraken Desktop

                Git Bash FAQ

                “@GitKraken Client is one of the best graphical tools to keep track of your code. I used just Bash before. GitKraken Client simplified my life a lot!” – @elenaManele

                Introduction to Git Bash

                Git Bash

                A shell is a computer application that integrates with the operating system and exposes its services to an end-user or other applications. Bash is an acronym for Bourne Again Shell, which is the GNU Project’s shell.

                Git Bash is not just a bash package for Microsoft Windows OS. It includes bash utilities, Unix collections like Secure Shell Protocol (SSH), Secure Copy Protocol (SCP), CAT (Unix utility that reads files sequentially, writing them to standard output), and other Unix-based collections compiled for Windows and Git features.  

                Git Bash provides a package for Git usage from the command line for Windows users, but GitKraken Desktop will make those same actions faster and more intuitive.

                Some things absent from Git Bash that users can enjoy in GitKraken esktop are auto-suggest and auto-complete for Git commands. Just start typing a command in the terminal tab and you will see relevant command suggestions with descriptions. Simply select the command you’re looking for and hit enter to automagically complete the Git action! 

                GitKraken Desktop’s magical auto-complete and auto-suggest for Git commands will help you accelerate your keyboard-driven Git workflow and increase your productivity.

                Git Bash Download

                Git Bash can be installed as other Windows applications, but you need to first download the executable file from the Git Bash download page and then follow the installation steps.

                1. Open your favorite browser and go to the Git Bash Download page on Git-scm.

                Git Bash Download screen

                2. After successfully downloading the Git Bash executable file, follow the installation steps.

                3. Voilà! Git Bash is ready to be used on your local Microsoft Windows platform.

                *If you used the above process to download Git Bash and Git for Windows for the first time, you may find instructions for configuring Git after your Git download useful. You’ll need to configure Git before you can access all of Git’s capabilities and features.

                How to Install Git Bash from the Command Line

                Git Bash comes with Git for Windows, so installing Git for Windows from the command line installs Git Bash too. Open PowerShell or Command Prompt and use one of the package managers below.

                Install Git Bash with winget

                winget, the Windows Package Manager, is included with current versions of Windows 10 and Windows 11. Run:

                winget install --id Git.Git -e --source winget

                Install Git Bash with Chocolatey

                If you use Chocolatey, run this from an administrator PowerShell window:

                choco install git

                Check that Git Bash is installed

                Close and reopen your terminal, then run:

                git --version

                If a version number appears, Git and Git Bash are installed. Open Git Bash from the Start menu, or right-click inside a folder and choose Open Git Bash here (on Windows 11, it’s under Show more options).

                Using Git Bash with GitHub

                In this section, we will look at how to run Git Bash and see some basic Git Bash commands required for Git integration. As Git Bash is a command line utility for Git on the Microsoft Windows platform, a basic Microsoft Windows command prompt (CMD) knowledge will be useful before getting started with Git Bash as they are very similar. If you do not know how to use CMD features, you can just take a look at the Windows Commands Reference from the Microsoft related web site.

                Now, let’s look at an example of using Git Bash with GitHub. You will start by linking your GitHub account with Git Bash to start configuring your GitHub repositories. If you do not have a GitHub account, you can create one directly from the GitHub home page.

                You can also refer to GitHub Docs for a very large and illustrative documentation about GitHub usage.

                Git Bash Commands

                Before going into steps on how to configure Git Bash and how to use it, you need to have a repository on GitHub. If this is your first time creating a repository on GitHub, checkout the related GitHub documentation for instructions on how to create a repository on GitHub.

                Now, let’s start configuring Git Bash with your GitHub account from scratch (examples in this article will be given from my personal GitHub account).

                1. First step is to run Git Bash. Double click the Git Bash icon on your Windows desktop to open your Git Bash interface.

                Git Bash Screen

                2. Use the cd Git bash command to change your active directory with your local repository workspace. cd and chdir in Windows CMD are aliases for setting the active directory.

                Now your active directory is your local repository. You can validate your active directory with the pwd command.

                Changing Active Directory in Git Bash

                3. This step is related to configuring your GitHub email and GitHub username. Type the below commands to link your GitHub email & GitHub username.

                git config --global user.name "%yourGitHubUserName%"
                git config --global user.email "%yourGitHubUserEmail%

                a. Now, you can clone the “git-bash-intro” repository to your local workspace. First, get the clone link from your GitHub repository as shown below:

                Getting the Clone Link of the Repository from GitHub

                b. Then, type the below command to clone your repository. You will use the clone link that you just copied from your GitHub repository.

                git clone "%yourRepositoryCloneLink%"

                Cloning a Git repository with Git Bash

                There are two important tips while cloning the Git repository. First: if you create a private repository, you also need to have related GitHub permissions. In this Git Bash example, the git-bash-intro repository was initialized as public. You can check the repository visibility section from GitHub Docs for more information about GitHub repository permissions.

                Another helpful tip is that you may face the below error while cloning a repository:

                fatal: could not create work tree dir 'git-bash-intro': permission denied

                This error states that you do not start Git Bash with the required permission to execute changes on your local Microsoft Windows platform. You can run Git Bash as administrator to resolve.

                4. Next, you will clone a repository to your local workspace to create a folder with the same name as your GitHub repository.

                git-bash-intro Folder

                5. Add a new text file called “firstCommit.txt” in your git-bash-intro local repository.

                Adding firstCommit.txt to a local repository: git-bash-intro

                6. It is time to reflect your local changes to your remote GitHub repository. Here, you will need to run a set of commands to push changes to your remote git-bash-intro repository.

                git add .
                
                git commit -m "first commit"
                
                git push origin master

                Now, let’s check what these Git bash commands mean:

                    • git add: This command adds content to the git index and updates the index with the local working tree. You can use “.” to add all working tree contents, or you can explicitly mention which content you want to add.
                      For instance; you can use “git add firstCommit.txt” in order to add just `firstCommit.txt` to the index.
                      For more details, you can visit the git-add documentation page on Git-scm.

                      • git commit: This command creates a new commit instance with the current content(s) of the index and with the log message describing the changes.
                        For more details, you can visit the Git Commit page in the GitKraken Learn Git center.

                        • git push: This command updates the remote refs with the local refs. In this example, we will update the master branch in our remote repository with our local changes.
                          For more details, you can visit the git-push documentation page on Git-scm.  

                          • git pull: This command will pull all changes from a remote repository branch to your local repository branch.
                            For more details, you can watch the beginner Git tutorial video: What is Git Pull?.   

                        7. Confirm the remote repository is in the GitHub account. Sure enough, the new file “firstCommit.txt” is there!

                        Checking Remote Repository after Pushing the Change

                        Now that you have received this Git Bash introduction, you can easily adopt these steps to your own projects as you integrate Git Bash with your GitHub account and use the Git version control system for your code base.

                        Alternatively, the process of integrating your command line terminal with Windows using GitKraken Desktop is much easier and takes far fewer steps. Simply download GitKraken Desktop on your Windows machine, open a new tab, and click New Terminal Tab. Then start typing your commands to get to work – seriously, it’s that easy!

                        Using GitHub with GitKraken Desktop

                        In comparison to using GitHub with Git Bash, in GitKraken Desktop, you can leverage the full power of the robust GitHub integration by simply signing into GitKraken Desktop using your GitHub credentials. From there, it’s just a few short steps to generate an SSH key and add to GitHub, and clone or fork a GitHub repository. Learn more about how developers use GitKraken Desktop with GitHub for a seamless Git workflow, including creating GitHub pull requests.

                        Set Git Bash as Your Default Terminal in GitKraken Desktop

                        Git Bash is a life saver for Windows users who want to leverage the power of the Git command line for their version control. It is easy to install Git Bash and start using it as stated throughout this article. 

                        And even better, with GitKraken Desktop, you can combine the power of Git Bash with visualization tools—like the commit graph, diff view, file history and blame, to unlock even more productivity. 

                        To use Git Bash as the default shell for GitKraken Desktop’s built in CLI, perform the following steps: 

                            • Select Preferences, represented by the gear icon, from the top toolbar

                            • From the left navigation, select Terminal

                            • Select Default Terminal 

                            • From the subsequent dropdown menu, select Git Bash 

                          You’re all set! Enjoy the power of Git Bash and the convenience of powerful visualization features, combined into one luxurious tool: GitKraken Desktop.

                          Select Git Bash as your default terminal in GitKraken Client

                          Git Bash FAQ

                          Q: How do I paste into Git Bash?

                          Press Shift+Insert, or right-click and choose Paste. To copy, select text with your mouse (Git Bash copies it automatically) or press Ctrl+Insert. You can turn on Ctrl+Shift+C and Ctrl+Shift+V under Options > Keys.

                          Q: How do I update Git Bash?


                          Update Git for Windows by running git update-git-for-windows in Git Bash, or download the latest installer from git-scm.com.

                          Q: Is Git Bash the same as Git?


                          No. Git is the version control system. Git Bash is a Windows shell that comes with Git for Windows, and you can use Git without it in CMD or PowerShell.

                          Q: Do I need Git Bash on Mac or Linux?


                          No. macOS and Linux already include a Unix shell, so you can run Git commands in the built-in terminal.

                          Q: Git Bash vs. PowerShell: which should I use?


                          Use Git Bash when you need Bash scripts, Unix commands, or a tutorial’s exact syntax. Use PowerShell for Windows administration and scripts. Git works the same in both.

                          GitKraken Desktop has revolutionized Git! Get a keyboard-driven, Git-enhanced terminal experience with powerful visualizations like the commit graph to help you accelerate your workflow.

                          This article was written by a guest author.

                          Updated: 11/09/2026

                          Git Bash is a Bash shell for Windows that comes bundled with Git for Windows. It lets you run Git commands and common Unix tools like ls, grep, ssh, and cat on Windows, with the same syntax you’d use on macOS or Linux.

                              • What it is: Bash plus Unix utilities, built on MSYS2, running in the Mintty terminal

                              • Cost: Free and open source

                              • Who it’s for: Windows developers who want Unix-style commands, or who follow tutorials written for macOS and Linux

                            Git Bash also translates paths automatically between Windows format (C:\Users\name) and Unix format (/c/Users/name), so scripts written for other systems usually run without changes.

                            You don’t need Git Bash to use Git on Windows, because Git also runs in CMD and PowerShell. Git Bash is the better choice when you want Bash scripts, Unix commands, or the exact syntax from a tutorial to work as written.

                            As Git experience increases, end-users can prefer using Git command line features for specific commands. Git Bash is one tool that provides command line features in the Windows Operating System to end-users. Another tool that developers can use to interact with the command line on Windows is GitKraken Desktop’s CLI.

                            Git Bash Topics Covered

                            Introduction to Git Bash

                            Git Bash Download

                            How to Install Git Bash from the Command Line

                            Using Git Bash with GitHub

                            Git Bash Commands

                            Set Git Bash as Your Default Terminal in GitKraken Desktop

                            Git Bash FAQ

                            “@GitKraken Client is one of the best graphical tools to keep track of your code. I used just Bash before. GitKraken Client simplified my life a lot!” – @elenaManele

                            Introduction to Git Bash

                            Git Bash

                            A shell is a computer application that integrates with the operating system and exposes its services to an end-user or other applications. Bash is an acronym for Bourne Again Shell, which is the GNU Project’s shell.

                            Git Bash is not just a bash package for Microsoft Windows OS. It includes bash utilities, Unix collections like Secure Shell Protocol (SSH), Secure Copy Protocol (SCP), CAT (Unix utility that reads files sequentially, writing them to standard output), and other Unix-based collections compiled for Windows and Git features.  

                            Git Bash provides a package for Git usage from the command line for Windows users, but GitKraken Desktop will make those same actions faster and more intuitive.

                            Some things absent from Git Bash that users can enjoy in GitKraken esktop are auto-suggest and auto-complete for Git commands. Just start typing a command in the terminal tab and you will see relevant command suggestions with descriptions. Simply select the command you’re looking for and hit enter to automagically complete the Git action! 

                            GitKraken Desktop’s magical auto-complete and auto-suggest for Git commands will help you accelerate your keyboard-driven Git workflow and increase your productivity.

                            Git Bash Download

                            Git Bash can be installed as other Windows applications, but you need to first download the executable file from the Git Bash download page and then follow the installation steps.

                            1. Open your favorite browser and go to the Git Bash Download page on Git-scm.

                            Git Bash Download screen

                            2. After successfully downloading the Git Bash executable file, follow the installation steps.

                            3. Voilà! Git Bash is ready to be used on your local Microsoft Windows platform.

                            *If you used the above process to download Git Bash and Git for Windows for the first time, you may find instructions for configuring Git after your Git download useful. You’ll need to configure Git before you can access all of Git’s capabilities and features.

                            How to Install Git Bash from the Command Line

                            Git Bash comes with Git for Windows, so installing Git for Windows from the command line installs Git Bash too. Open PowerShell or Command Prompt and use one of the package managers below.

                            Install Git Bash with winget

                            winget, the Windows Package Manager, is included with current versions of Windows 10 and Windows 11. Run:

                            winget install --id Git.Git -e --source winget

                            Install Git Bash with Chocolatey

                            If you use Chocolatey, run this from an administrator PowerShell window:

                            choco install git

                            Check that Git Bash is installed

                            Close and reopen your terminal, then run:

                            git --version

                            If a version number appears, Git and Git Bash are installed. Open Git Bash from the Start menu, or right-click inside a folder and choose Open Git Bash here (on Windows 11, it’s under Show more options).

                            Using Git Bash with GitHub

                            In this section, we will look at how to run Git Bash and see some basic Git Bash commands required for Git integration. As Git Bash is a command line utility for Git on the Microsoft Windows platform, a basic Microsoft Windows command prompt (CMD) knowledge will be useful before getting started with Git Bash as they are very similar. If you do not know how to use CMD features, you can just take a look at the Windows Commands Reference from the Microsoft related web site.

                            Now, let’s look at an example of using Git Bash with GitHub. You will start by linking your GitHub account with Git Bash to start configuring your GitHub repositories. If you do not have a GitHub account, you can create one directly from the GitHub home page.

                            You can also refer to GitHub Docs for a very large and illustrative documentation about GitHub usage.

                            Git Bash Commands

                            Before going into steps on how to configure Git Bash and how to use it, you need to have a repository on GitHub. If this is your first time creating a repository on GitHub, checkout the related GitHub documentation for instructions on how to create a repository on GitHub.

                            Now, let’s start configuring Git Bash with your GitHub account from scratch (examples in this article will be given from my personal GitHub account).

                            1. First step is to run Git Bash. Double click the Git Bash icon on your Windows desktop to open your Git Bash interface.

                            Git Bash Screen

                            2. Use the cd Git bash command to change your active directory with your local repository workspace. cd and chdir in Windows CMD are aliases for setting the active directory.

                            Now your active directory is your local repository. You can validate your active directory with the pwd command.

                            Changing Active Directory in Git Bash

                            3. This step is related to configuring your GitHub email and GitHub username. Type the below commands to link your GitHub email & GitHub username.

                            git config --global user.name "%yourGitHubUserName%"
                            git config --global user.email "%yourGitHubUserEmail%

                            a. Now, you can clone the “git-bash-intro” repository to your local workspace. First, get the clone link from your GitHub repository as shown below:

                            Getting the Clone Link of the Repository from GitHub

                            b. Then, type the below command to clone your repository. You will use the clone link that you just copied from your GitHub repository.

                            git clone "%yourRepositoryCloneLink%"

                            Cloning a Git repository with Git Bash

                            There are two important tips while cloning the Git repository. First: if you create a private repository, you also need to have related GitHub permissions. In this Git Bash example, the git-bash-intro repository was initialized as public. You can check the repository visibility section from GitHub Docs for more information about GitHub repository permissions.

                            Another helpful tip is that you may face the below error while cloning a repository:

                            fatal: could not create work tree dir 'git-bash-intro': permission denied

                            This error states that you do not start Git Bash with the required permission to execute changes on your local Microsoft Windows platform. You can run Git Bash as administrator to resolve.

                            4. Next, you will clone a repository to your local workspace to create a folder with the same name as your GitHub repository.

                            git-bash-intro Folder

                            5. Add a new text file called “firstCommit.txt” in your git-bash-intro local repository.

                            Adding firstCommit.txt to a local repository: git-bash-intro

                            6. It is time to reflect your local changes to your remote GitHub repository. Here, you will need to run a set of commands to push changes to your remote git-bash-intro repository.

                            git add .
                            
                            git commit -m "first commit"
                            
                            git push origin master

                            Now, let’s check what these Git bash commands mean:

                                • git add: This command adds content to the git index and updates the index with the local working tree. You can use “.” to add all working tree contents, or you can explicitly mention which content you want to add.
                                  For instance; you can use “git add firstCommit.txt” in order to add just `firstCommit.txt` to the index.
                                  For more details, you can visit the git-add documentation page on Git-scm.

                                  • git commit: This command creates a new commit instance with the current content(s) of the index and with the log message describing the changes.
                                    For more details, you can visit the Git Commit page in the GitKraken Learn Git center.

                                    • git push: This command updates the remote refs with the local refs. In this example, we will update the master branch in our remote repository with our local changes.
                                      For more details, you can visit the git-push documentation page on Git-scm.  

                                      • git pull: This command will pull all changes from a remote repository branch to your local repository branch.
                                        For more details, you can watch the beginner Git tutorial video: What is Git Pull?.   

                                    7. Confirm the remote repository is in the GitHub account. Sure enough, the new file “firstCommit.txt” is there!

                                    Checking Remote Repository after Pushing the Change

                                    Now that you have received this Git Bash introduction, you can easily adopt these steps to your own projects as you integrate Git Bash with your GitHub account and use the Git version control system for your code base.

                                    Alternatively, the process of integrating your command line terminal with Windows using GitKraken Desktop is much easier and takes far fewer steps. Simply download GitKraken Desktop on your Windows machine, open a new tab, and click New Terminal Tab. Then start typing your commands to get to work – seriously, it’s that easy!

                                    Using GitHub with GitKraken Desktop

                                    In comparison to using GitHub with Git Bash, in GitKraken Desktop, you can leverage the full power of the robust GitHub integration by simply signing into GitKraken Desktop using your GitHub credentials. From there, it’s just a few short steps to generate an SSH key and add to GitHub, and clone or fork a GitHub repository. Learn more about how developers use GitKraken Desktop with GitHub for a seamless Git workflow, including creating GitHub pull requests.

                                    Set Git Bash as Your Default Terminal in GitKraken Desktop

                                    Git Bash is a life saver for Windows users who want to leverage the power of the Git command line for their version control. It is easy to install Git Bash and start using it as stated throughout this article. 

                                    And even better, with GitKraken Desktop, you can combine the power of Git Bash with visualization tools—like the commit graph, diff view, file history and blame, to unlock even more productivity. 

                                    To use Git Bash as the default shell for GitKraken Desktop’s built in CLI, perform the following steps: 

                                        • Select Preferences, represented by the gear icon, from the top toolbar

                                        • From the left navigation, select Terminal

                                        • Select Default Terminal 

                                        • From the subsequent dropdown menu, select Git Bash 

                                      You’re all set! Enjoy the power of Git Bash and the convenience of powerful visualization features, combined into one luxurious tool: GitKraken Desktop.

                                      Select Git Bash as your default terminal in GitKraken Client

                                      Git Bash FAQ

                                      Q: How do I paste into Git Bash?

                                      Press Shift+Insert, or right-click and choose Paste. To copy, select text with your mouse (Git Bash copies it automatically) or press Ctrl+Insert. You can turn on Ctrl+Shift+C and Ctrl+Shift+V under Options > Keys.

                                      Q: How do I update Git Bash?


                                      Update Git for Windows by running git update-git-for-windows in Git Bash, or download the latest installer from git-scm.com.

                                      Q: Is Git Bash the same as Git?


                                      No. Git is the version control system. Git Bash is a Windows shell that comes with Git for Windows, and you can use Git without it in CMD or PowerShell.

                                      Q: Do I need Git Bash on Mac or Linux?


                                      No. macOS and Linux already include a Unix shell, so you can run Git commands in the built-in terminal.

                                      Q: Git Bash vs. PowerShell: which should I use?


                                      Use Git Bash when you need Bash scripts, Unix commands, or a tutorial’s exact syntax. Use PowerShell for Windows administration and scripts. Git works the same in both.

                                      GitKraken Desktop has revolutionized Git! Get a keyboard-driven, Git-enhanced terminal experience with powerful visualizations like the commit graph to help you accelerate your workflow.

                                      Visual Studio Code is required to install GitLens.

                                      Don’t have Visual Studio Code? Get it now.

                                      Team Collaboration Services

                                      Secure cloud-backed services that span across all products in the DevEx platform to keep your workflows connected across projects, repos, and team members
                                      Launchpad – All your PRs, issues, & tasks in one spot to kick off a focused, unblocked day. Code Suggest – Real code suggestions anywhere in your project, as simple as in Google Docs. Cloud Patches – Speed up PR reviews by enabling early collaboration on work-in-progress. Workspaces – Group & sync repos to simplify multi-repo actions, & get new devs coding faster. DORA Insights – Data-driven code insights to track & improve development velocity. Security & Admin – Easily set up SSO, manage access, & streamline IdP integrations.
                                      winget install gitkraken.cli