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
TortoiseGit
Install TortoiseGit
from here
Install GIT for Windows
from here
Installing Tortoise Git
After installing Git for Windows a console appears
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
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 for GitLab
Configuring Tortoise Git for GitLab
After a tiring mouse movement for ~ 30 seconds you will see the result.
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 for GitLab
If successful, you will land on
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 for GitLab
To get the exact url you want to clone, go to the required branch and click the Clone button.
Configuring Tortoise Git for GitLab
Choose Clone with SSH. To copy this address you need to click the copy icon.
Configuring Tortoise Git for GitLab
Let us create the folder Gitlab_test_HeiHei.ru
Configuring Tortoise Git for GitLab
Right-click and choose Git Clone
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 for GitLab
If successful, TortoiseGit will show the message Success
Configuring Tortoise Git for GitLab
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 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 for GitLab
To change the branch with which you synchronised the folder on your computer.
Configuring Tortoise Git for GitLab
Article author: Andrei Olegovich