DEV Community

Cover image for How to install and configure Git on Windows OS ?
Supritha
Supritha

Posted on • Updated on

How to install and configure Git on Windows OS ?

I will also soon be publishing it on GeeksforGeeks

Introduction✨

In this blog, you will be learning how to install, setup and configure Git on Windows OS. This will take, like 10 minutes!, it's that easy.

git

Let's get started!

comp

Step one - Installation

download

  • Click on the downloaded .exe file install1

Step two - Set-up

  • Allow the app to make changes to your device by clicking Yes on the User Account Control dialog that opens.
    setup1

  • Give GNU General Public License a read, and then click on Next.
    setup2


It is recommended to leave the options as default in the next few steps.

  • Leave the installation location on default and click on Next.
    setup3

  • Leave the installation components on default and click on Next.
    setup4

  • Set up will create the program's shortcut in a Start Menu folder. Click Next.
    setup5

  • Open the drop-down menu to select a text editor of your choice. I have chosen VS Code here.
    setup6

  • Set up for Git to name the branch after "git init". Leave it on default.
    setup7

  • Adjusting your path environment - Select the recommended option.
    setup8

  • The next option relates to server certificates. If you’re working in an Active Directory environment, you may need to switch to Windows Store certificates. Click Next.
    setup9

  • Configuring the line ending conversions : Recommended to select the default option.
    setup10

  • Choose the terminal emulator you want to use. The default MinTTY is recommended, for its features. Click on Next.
    setup11

  • Default behavior of git pull : Default option
    setup12

  • Choose a credential helper : Git Credential Manager Core
    setup13


From here, the options are customizable, you can leave it default if you want.

  • Default option recommended. If you want to use symbolic links, which are like shortcuts for the command line, tick the box. Click Next.
    setup14

  • Click on Install after customization.
    setup15


Finish the Git setup

  • Click on Finish.
    setup16

  • Launch Git Bash : Simply go to Start on your Windows, and then you will find a folder "Git". Click on it.
    setup17


Step three - Make a test Directory

  • Git command to make a new directory :
mkdir test
Enter fullscreen mode Exit fullscreen mode

mkdir

  • To go into the test folder :
cd test
Enter fullscreen mode Exit fullscreen mode

cd

  • To initialize it : Initializes an empty Git repository.
git init
Enter fullscreen mode Exit fullscreen mode

init

  • Go into the file path as shown on your terminal in the above step. As you can see below, a folder test has been created!

test

  • To clear your terminal :
clear
Enter fullscreen mode Exit fullscreen mode

clear


Step four - Learn basic Git commands (Optional)

After making a directory, now you can add files to this directory!
You can learn Git commands from the resources in my blog below
👇


Step five - Configuration

  • Configure Git with your username. Enter your full name or GitHub username in the code below.
git config --global user.name "Your-Full-Name-here"
Enter fullscreen mode Exit fullscreen mode

configuser


  • Configure Git with your e-mail. Enter your email address in the code below.
git config --global user.email "your-email-address-here"
Enter fullscreen mode Exit fullscreen mode

configmail

Next, you can run

git config --list
Enter fullscreen mode Exit fullscreen mode

  • Configure Git with your chosen code editor.

If you use VSCode :

git config --global core.editor "code --wait"
Enter fullscreen mode Exit fullscreen mode

vscode


If you use Sublime Text :

git config --global core.editor "'C:/Program Files/Sublime Text 2/sublime_text.exe' -n -w"
Enter fullscreen mode Exit fullscreen mode

sublimetext


If you use Atom Editor :

git config --global core.editor "atom --wait"
Enter fullscreen mode Exit fullscreen mode

atom


You're all set up if -

✅ You've installed Git.
✅ You've configured Git with username and email.
✅ You've configured Git to your chosen editor.


Thank you for reading!🙌

Share your views in the comments down below! :)
My twitter

Like it and share it for more such articles.

Like what I do?

Support me by buying me a coffee ☕.

Top comments (0)