How to install Git on windows

Zainab Daodu
5 min readDec 22, 2022

--

Git is a popular open-source project management tool that keeps track of projects across several teams and revision levels.

Git is an open-source version control system (VCS) used to effectively manage small to very large projects. It is a DevOps tool for source code management. Git tracks changes made to the source code, enabling non-linear development and allowing several engineers to collaborate almost instantly.

Non-linear Development

Git enables users to work remotely on a project from anywhere globally. A user picks up an issue to work on, makes the necessary changes, push the changes and the cycle continues. This is possible because of Git’s non-linear development tendency. Git has features specifically designed for viewing and navigating a non-linear development history and facilitates quick branching and merging. Git assumes that you can merge changes more often than you write them.

Here is a step-by-step tutorial for installing Git on Windows 10. Stay on this guide!

Prerequisites

  • Administrator privileges to the operating system
  • Access to a command line interface
  • Coding text editor (VS Code, Sublime text, Notepad++ etc.)
  • GitHub Username and password

Install Git.

Follow the process below to successfully install Git on your Windows operating system:

Step 1: Download the latest version of Git.

Step 2: Launch the installer

Step 3: Select the installation location and click Next

Step 4: Leave the default Selected Components and click Next.

Step 5: The installer offers Git as the default Start Menu Folder for the program’s shortcut, click Next.

Step 6: Use the drop-down menu to select Visual Studio Code as Git’s default editor, or choose your preferred editor. Click Next.

Step 7: In the dialogue select Let Git decide and click Next.

This step enables you to change the name of your first branch. The default value is “master.” Using the default selection is recommended unless your team demands a different name.

Step 8: Select Git from the command line and also from 3rd-party software and click Next.

This installation phase permits the modification of the PATH environment. The PATH is the collection of folders included by default when you execute a command from the command line.

Step 9: Select Use bundled OpenSSH and click Next.

The installation now requests the SSH client to be used with Git. Git has its SSH client, so you may leave the default choice if you don’t need a particular one.

Step 10: Select “use the native Windows secure channel library” and click Next.

The following option concerns server certificates. The majority of consumers should use the default. You may need to convert to Windows Store certificates if working in an Active Directory environment.

Step 11: Leave the default and click Next for the rest of the configuration.

Step 12: Leave the experimental configuration option unchecked and click Next.

Step 13: Wait till it installs completely and clicks Finish. Then launch Git Bash.

Congratulations! You have successfully installed Git on your Windows PC.

Launch Git

Once installed, follow the processes below to use Git on your Windows PC.

Step 1: Launch the Git Bash.

Step 2: Follow the Git command line below to create an issue:

  1. Check the Git version:
$ git — version

2. For any help:

$ git help config
$ git config — help

3. Create a local directory:

$ mkdir test
$ cd test

4. To initialize the directory:

$ git init

5. Go to the folder where “test” is created and create a text document named “demo.txt”. In the “demo” file, put any content, like “Hello Zaycodes.” Save and close the file.

6. Enter the Git bash interface and type in the following command to check the status:

$ git status

7. Add the “demo.txt” file you created to the current directory using the following command:

$ git add demo.txt

8. Make a commit using the following command:

$ git commit -m “committing a text file”

9. Link the Git to a Github Account:

$ git config — global user.username

Note: Use your correct github username.

10. Open your Github account, create a new repository with the name “test_demo” and click on “Create repository.” This is the remote repository. Next, copy the link of “test_demo.”

11. Go back to Git bash and link the remote and local repository using the following command:

$ git remote add origin <link>

Like this:

git remote add origin https://github.com/Ladyprowess/test_demo.git

12. Push the local file onto the remote repository using the following command:

$ git push origin master

Step 3: Go to Github and click on “test_demo” and check if the local file “demo.txt” is pushed to this repository.

Conclusion

This post covers instructions on installing and setting up Git on Windows operating system. If you find this article useful, don’t forget to hit the clap button or leave a comment if you have any questions. Also, feel free to ask questions or contribute to my conversation on Twitter.

--

--

Zainab Daodu
Zainab Daodu

Written by Zainab Daodu

Zainab is a technical writer with years of experience in writing technical documentation and articles to improve developer experience.

No responses yet