Documentation Hub

Git - Version Control System

Introduction to Git

Git is a free and open-source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. It's the de facto standard for source code management.

Key features include:

Core Concepts

Understanding Git involves grasping a few fundamental concepts:

Essential Git Commands

Here are some of the most commonly used Git commands:

Initialize a Repository

git init

Creates a new Git repository in the current directory.

Clone a Repository

git clone [url]

Copies an existing Git repository from a remote source.

Add Files to Staging

git add [file]

Stages changes in a file to be included in the next commit.

Commit Changes

git commit -m "Your commit message"

Saves the staged changes to the repository history.

View Status

git status

Shows the current state of your working directory and staging area.

View History

git log

Displays the commit history of the repository.

Create a Branch

git branch [branch-name]

Creates a new branch for new features or experiments.

Switch Branches

git checkout [branch-name]

Switches to a different branch.

Merge Branches

git merge [branch-name]

Integrates changes from one branch into the current branch.

Fetch Remote Changes

git fetch

Downloads commits, files, and refs from a remote repository.

Pull Remote Changes

git pull

Fetches from and integrates with another repository or a local branch.

Push Local Commits

git push

Updates remote refs along with associated objects.

Further Learning

This is just a brief overview. For comprehensive information and advanced topics, please refer to the official Git documentation:

Official Git Documentation

You can also explore interactive tutorials and community resources online.