By admin , 28 April 2026

Introduction

Most people learn Git the hard way, through small disasters. This page collects the most frequent beginner mistakes and how to avoid (or recover from) them. Read it once now and again after a month of use; the second pass will make more sense.

Committing as the wrong identity

Forgetting to set user.email per repository leaks personal addresses into work commits. Always set a per-repo identity in work clones:

By admin , 28 April 2026

Introduction

Git ships with extensive built-in documentation. Knowing how to summon it quickly will save you hours of guesswork. This page tours the help system from one-liners to full manuals.

Three ways to ask

Each command supports three forms of help:

git help <command>     # full man page in your pager
git <command> --help    # same thing
git <command> -h        # short usage summary

Example:

By admin , 28 April 2026

Introduction

A .gitignore file lists patterns Git should treat as untracked and never offer to add. It keeps build artifacts, secrets, OS metadata, and editor scratch files out of your repository.

By admin , 28 April 2026

Introduction

git log walks the commit graph from a starting point (default: HEAD) backwards through parents, printing each commit. It is the primary tool for exploring project history.

Basic usage

git log
git log --oneline
git log --oneline --graph --decorate --all

The last form is the swiss-army view: a compact graph of every branch with refs decorated.

By admin , 28 April 2026

Introduction

The index, also called the staging area or the cache, is one of Git's distinguishing features. It is a binary file at .git/index that holds the tree you intend to commit next. Understanding the index removes most of the mystery from git status output.

By admin , 28 April 2026

Introduction

Almost every Git session follows the same three-step rhythm: edit files in your working tree, stage the changes you want to record, and commit them to history. Mastering this loop is the foundation of everything else.

By admin , 28 April 2026

Introduction

git init turns an ordinary directory into a Git repository. It creates a hidden .git directory holding all of Git's bookkeeping: objects, refs, configuration, and hooks. The working tree (your normal files) is unchanged.

Initializing a project

mkdir my-project
cd my-project
git init
# Initialized empty Git repository in /home/ada/my-project/.git/

Since Git 2.28 you can set the initial branch name on the command line:

By admin , 28 April 2026

Introduction

Before your first commit, Git needs to know who you are. git config stores key-value pairs in three scopes: system (all users), global (your user account), and local (a single repository). The global scope lives at ~/.gitconfig on Unix and %USERPROFILE%\.gitconfig on Windows.

Identity

Set your name and email; these are baked into every commit you make:

By admin , 28 April 2026

Introduction

Installing Git is straightforward on every major platform. This page walks through the recommended installation method for Linux, macOS, and Windows, and shows how to verify the install.

Linux

Most Linux distributions ship Git in their default package repositories. Use your package manager:

By admin , 28 April 2026

Introduction

Git is a distributed version control system originally created by Linus Torvalds in 2005 for Linux kernel development. It tracks changes to files over time, lets multiple people collaborate, and gives every developer a complete copy of the project history. Today Git powers most of the world's open source and enterprise software development.