How to Clone and Configure Git repository for Windows user?

Development team member want to connect to repository hosted at Gitlab server. First of all Gitlab server administrator create user and send invitation to user to join project. The Git client should be installed at Developer’s system to execute git related commands. In this post we will discuss installing and configure Git repository for windows user.

Steps For Installing Git for Windows:

Download Git for Windows

1- Download Git client Version 2.40.0 from official website for OS (Windows, Linux, MacOS) or what you have on your system.

install and configure Git for windows user -- Download

Clone and Configure Git for Windows

Select installer file to download with the compatibility of system architecture. Currently most of the OS are 64 bit.

or we can download file by Windows power Shell command

winget install –id Git.Git -e –source winget

install and configure Git for windows user

2- Extract and Launch Git Installer:

2- After download completed, and Install Git Client with Administrator Rights. Follow the wizard steps by step instruction.

install and configure Git for windows user -- Extract file

2.1 – Read carefully terms & Conditions, and click on Next Button.

install and configure Git for windows user -- GNU public license

2.2 – Select Installation path by clicking on Browse button where Git files will store in system, and click on next button.

install and configure Git for windows user -- Destination Location

2.3 – Select required components that need to install along Git client or keep by default selected and click on Next to continue installation process.

install and configure Git for windows user -- Select component

2.4 – Type Git shortcut name or keep default name and click Next button.

install and configure Git for windows user -- Menu folder

2.5 – Select or choose file editor from the list, i have selected Notepad ++ as a deafault editor.

install and configure Git for windows user - note pad editor

2.6 – The next step allows you to choose a different name for your initial branch. The default is ‘master.’ Unless you’re working in a team that requires a different name, leave the default option and click Next.

install and configure Git for windows user - New repository

2.7- This installation step allows you to change the PATH environment. The PATH is the default set of directories included when you run a command from the command line. Leave this on the middle (recommended) selection and click Next.

install and configure Git for windows user - Path environment

Server Certificates, Line Endings and Terminal Emulators

2.8- Choose SSH shell from given options. Git already comes with its own SSH client, so if you don’t need a specific one, leave the default option and click Next.

install and configure Git for windows user -bundle openSSH

2.9 – Click next to keep default selected SSH library option. Most users should use the default. If you’re working in an Active Directory environment, you may need to switch to Windows Store certificates. Click Next.

install and configure Git for windows user -Openssl

2.10 – Click Next and keep selected configuration. This relates to the way data is formatted and changing this option may cause problems. Click Next.

Git- ending conversions

2.11- The default MinTTY is recommended, for its features. keep selected configuration and click on next button to proceed installation. Click Next.

Git- MinPutty

2.12- The installer now asks what the git pull command should do. The default option is recommended unless you specifically need to change its behavior. Click Next to continue with the installation.

Git Pull

2.13 – Choose credential helper to record the credentials of developer. Leave the default option as it is the most stable one, and click Next.

Git Choose credential

Additional Customization Options:

2.14 – From Below screen keep default selection. however this step allows you to decide which extra option you would like to enable. If you use symbolic links, which are like shortcuts for the command line, tick the box. Click Next.

Git- Configure additional options

2.15 – the options to include support for pseudo controls and a built-in file system monitor were offered. Unless you are feeling adventurous, leave them unchecked and click Install.

Git- Configure Excremental Options

2.16 – The configuration is completed and Installation process will start.

Git installation completed

Complete Git Installation Process

2.17 – Now Installation process completed. Select “Launch Git Bash” option and click Finish button.

setup done

Git Client Installation completed now. Next we will select “Launch Git Bash” to launch Bash command line interface.

Connecting to a Remote Repository

Launch Git-Bash console from Windows Search to configure Git repository.

bash launch

Finally Git Bash console will open like below

console

1- Verify the correct version has installed with command

git –version

Create a Test Directory:

Create a new test directory (folder) by entering the following in windows PowerShell Console. Perform following commands in given sequence.

version

Clone a GitHub Repository:

Go to your repository on GitHub. In the top right above the list of files, open the Clone or download drop-down menu. Copy the URL for cloning over HTTP/HTTPS.

Gitlab Clone link

Switch to your PowerShell window, and enter the following:

clone Credentials

After entering credentials, then GIT server will the user to download repository to local directory.

 Clone Started

Depending upon network performance or depends upon the size of repository, downloading process will take time.

Clone Done

Pushing Local Files to the Remote Repository:

Once you’ve done some work on the project, you may want to submit those changes to the remote project on GitHub.

  • create a new text file by entering the following into your PowerShell window:

new-item test.txt

  • Now check the status of your new Git branch and untracked files:

git status

  • Add your new file to the local project:

git add test.txt

  • Run git status again to make sure the text.txt file has been added. Next, commit the changes to the local project:

git commit -m “test1”

  • Finally, push the changes to the remote GitHub repository:

git push

Conclusion:

After installing Git on your Windows and Configure Git repository, Programmers can coordinate with each other to have the collaborative repository with Git.

Read Related Topics:

Gitlab Error-500 Login for 2FA users fails after a restore

Problem with Upgrading Gitlab EE from Older to Latest Version

Leave a Reply