Installing Git on Windows

Introduction

Usually git is not installed by default, so you need to install Git Bash , Tortoise Git or some other solution.

Installing Git Bash

You can read about installing and configuring Git Bash on Windows in the article Git Bash

Banner image

TortoiseGit

Install TortoiseGit from here

Install GIT for Windows from here

installing Tortoise git for windows image from www.aredel.com
Git Setup
Installing Tortoise Git

After installing Git for Windows a console appears

installing Tortoise git for windows image from www.aredel.com
Git Setup
Installing Tortoise Git

During the installation of TortoiseGit you will need to specify the path to Git.exe

Git.exe appears only after installing Git for Windows, so mind the order of the steps.

installing Tortoise git for windows image from www.aredel.com
Git Setup
Installing Tortoise Git

TortoiseGit and GitLab

To connect TortoiseGit to a remote repository, for example GitLab you need to set up access by keys.

To do this you need to start generating keys. I choose the option Generate PuTTY key pair

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab
configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

After a tiring mouse movement for ~ 30 seconds you will see the result.

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

The keys must be saved to a directory on your PC.

It is advisable to remember the name and the path to the directory.

Then you need to visit the SSH Keys upload page and upload your PUBLIC key there.

It must start with ssh-rsa.

The easiest way is to copy it from the putty window

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

If successful, you will land on

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

Next you need to specify the path to the key in the TortoiseGit settings. I do not know where it is now in the settings themselves. It used to be in the Remotes item, if I am not mistaken.

The settings look as follows, but we will not dig around there; we will enter the path to the key in the next step.

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

To get the exact url you want to clone, go to the required branch and click the Clone button.

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

Choose Clone with SSH. To copy this address you need to click the copy icon.

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

Let us create the folder Gitlab_test_HeiHei.ru

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

Right-click and choose Git Clone

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

Paste the address we copied from GitLab earlier into the URL field

Then point to the path to the private key and press OK.

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

If successful, TortoiseGit will show the message Success

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab
Banner image

Branches

When you work with Git it is important to understand how branches work.

If you are a developer, the standard branch for you is most likely called dev.

You make your commits or pushes into it, and the senior programmer then merges them into the branch master

You can view the list of all branches in the Repository → Branches section

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

There will be the master and dev branches and any that the developers have invented.

Sometimes they may be tied to certain stories in the task tracker (for example Pivotal Tracker ) and may simply appear to test some hypotheses.

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab

To change the branch with which you synchronised the folder on your computer.

configuring Tortoise git to work with gitlab on windows image from www.aredel.com
Git Setup
Configuring Tortoise Git for GitLab
Banner image

Article author: Andrei Olegovich