Connect with us

Git

How to Install Git on Windows Using CMD?

Spread the love

Git is a powerful version control system used for tracking changes in projects, particularly in software development.

Installing Git on Windows and setting it up via the Command Prompt (CMD) is straightforward. This blog provides a step-by-step guide to help you get started.

Why Install Git?

Git is essential for:

  1. Version Control: Tracking changes and collaborating efficiently.
  2. Team Collaboration: Enabling seamless teamwork on coding projects.
  3. Integration: Working with platforms like GitHub, GitLab, and Bitbucket.

Prerequisites

  1. Administrator Access: You need administrative privileges to install software.
  2. Stable Internet Connection: Required to download the Git installer.

Steps to Install Git on Windows Using CMD

1. Download the Git Installer

  1. Open your browser and visit the official Git website: https://git-scm.com.
  2. Click the Download for Windows button. The website will automatically detect the appropriate version for your system.

2. Run the Installer

  1. Locate the downloaded .exe file in your Downloads folder.
  2. Run the installer by double-clicking it.

3. Configure Installation via GUI

The Git installer opens a configuration window. Follow these steps:

  1. Select Destination Folder: Choose the default or specify a custom folder, then click Next.
  2. Select Components: Ensure the following options are selected:
    • Git Bash Here
    • Git GUI Here
    • Associate .git files with Git
  3. Adjust Path Environment:
    • Select Use Git from the Command Prompt (recommended) to enable Git in CMD.
  4. Set Line Ending Conversions: Choose Checkout Windows-style, commit Unix-style line endings.
  5. Default Editor: Select your preferred text editor (e.g., Vim, Nano, or VS Code).

4. Verify Git Installation via CMD

Once the installation is complete:

  1. Open the Command Prompt:
    • Press Win + R, type cmd, and hit Enter.
  2. Check the Git version to confirm installation: git --version If Git is installed correctly, it will display the installed version, e.g.: git version 2.x.x

Optional Configuration

1. Set Global Username and Email

After installation, configure your Git identity:

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

2. Verify Configuration

Check your global configuration settings:

git config --list

This will display your configured username and email.


Common Issues and Troubleshooting

1. Command Not Recognized

If git is not recognized in CMD:

  • Ensure that the Git installation path is added to the PATH environment variable.
  • Re-run the Git installer and select the correct PATH option.

2. Version Outdated

To update Git, visit the official website and download the latest installer. Follow the installation process as outlined above.


Conclusion

Installing Git on Windows using CMD is simple and sets the stage for effective version control.

By following this guide, you’ll have Git installed, configured, and ready to use in no time. Regular updates and configurations ensure you get the most out of this powerful tool..

Start managing your projects efficiently with Git today.


Spread the love
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *