eCommece

Getting started with Git

Saif Rao
Nov 26, 2025
1 min read
vindovs-11-1920x1080-vindovs-11-23900

Getting started with Git

Git is a distributed version control system that enables developers to track code changes, collaborate in teams, and manage project history. In Git, you can store different file versions, access them when needed, and work together on a project with no risk of data loss.

Git streamlines complex project work, delivers transparency of changes, and helps avoid teamwork conflicts.

In this tutorial, we will explore the main commands for using Git without the GUI.

  1. Getting started

  2. Working with repositories

  3. Working with branches

  4. Commits

  5. Pushing changes

  6. Conflict resolution

  7. Additional commands

Getting started

Install Git:

  1. Download Git from the

    official website

    .

  2. Run the installation file and follow the setup wizard's prompts.

  3. During the installation, select to integrate with the command line or PowerShell.

Working with repositories

Initializing a repository (git init)

Initialization allows Git to index files and start tracking changes in a directory.

  1. Create a directory for your project by running this command in the terminal:

    mkdir <path_to_directory>

  2. If you need to initialize a repository in an existing directory, skip this step.

  3. Navigate to the project directory:

    cd <path_to_directory>

  4. To initialize the repository, run this command:

    git init

Command

Use case

git log

Viewing history.

git blame <file_name>

Viewing changes in a specific file. This command shows who made the changes and in which lines.

git blame -L <start_line>, <end_line> <file_name>

Viewing changes within a given line range in the selected file.

git branch

Viewing all repository branches. The current branch will be marked with *.