Site icon Student Projects Live

Git Installation and Setup Guide

Understanding and Resolving Merge Conflicts in GIT

Part 1: Git Installation and Setup Guide

Prerequisites


Step 1: Download Git

  1. Open your web browser.
  2. Go to the official Git website:
  3. Click Download for Windows.
  4. The download should start automatically.

Step 2: Install Git

  1. Double-click the downloaded installer.
  2. Click Yes if prompted by User Account Control.
  3. Click Next through the installation wizard.

For most users, the default settings are recommended.

Recommended Installation Options

  1. Click Install.
  2. Wait for the installation to complete.
  3. Click Finish.

Step 3: Verify Git Installation

  1. Open Command Prompt, PowerShell, or the terminal in Visual Studio Code.
  2. Run:
git --version

Example output:

git version 2.xx.x.windows.x

If you see a version number, Git has been installed successfully.


Step 4: Configure Git

Set your name:

git config --global user.name "Your Name"

Example:

git config --global user.name "John Smith"

Set your email address:

git config --global user.email "your@email.com"

Example:

git config --global user.email "john@email.com"

Step 5: Verify Your Configuration

Run:

git config --list

Example output:

user.name=John Smith
user.email=john@email.com
init.defaultBranch=main

Step 6: Check the Default Branch

Run:

git config --global init.defaultBranch main

This ensures that all newly created repositories use main as the default branch.


Step 7: Access Your Self-Hosted GitLab Instance

  1. Open your browser.
  2. Visit the URL provided by your organization or administrator, for example:
    • https://gitlab.yourcompany.com
  3. Sign in with your self-hosted GitLab credentials.
  4. If you do not have an account, contact your GitLab administrator to create one or grant access.

Step 8: Confirm Everything Is Ready

Run these commands:

git --version
git config --list

If both commands work without errors, your Git installation is complete and ready to use with your self-hosted GitLab instance.


Next Tutorial

The next part of this guide will cover:

Click Here to view the Next tutorial.


Tutorial Index:

Exit mobile version