What is Git? (original) (raw)

Last Updated : 11 May, 2026

Git is a distributed version control system that helps track and manage changes in code over time. It allows multiple developers to work on the same project, view previous versions, and restore changes when needed.

Features of Git

**1. Version Control System: Git keeps track of every change you make to your project files. You can go back to previous versions is any requirement arises.

**2. Repositories: A Git repository (or repo) is like a project's central hub where everything related to your work is stored and managed. There are two main types:

**3. Commits: Every time you make changes and save them in Git, these are called commits. The repository keeps track of all the commits you have made.

**4. Branches: A repository allows you to create Branches and work on new features and fixes. For example, you can have a "main" branch for stable code and a "feature" branch for new features you're developing.

**5. Merging: Once you are done with the branches you have made, you can merge those branches into main branch. This adds the changes you have made in the rest of the project.

**6. Cloning: Cloning is a process of making a complete copy of Git repository. It's like copying the entire project from central location ( like website) to your own computer.

Reasons to Choose Git

Steps to Setup a Git

**Install Git: Download and install Git from the official Git website.

**Configure Git: Set up your username and email.

git config --global user.name "Your Name" git config --global user.email "your.email@example.com"

**Create a Repository: Navigate to your project directory and initialize a Git repository.

git init

**Make Your First Commit: Add files to the staging area and commit your changes.

git add . git commit -m "Initial commit"

Basic Git Commands

git init

git clone [url]

git add [file]

git commit -m "Your commit message"

git push origin branch-name

git pull origin branch-name

git status

Drawbacks

Git Workflow

A Git workflow is a set of guidelines for using Git in a structured and efficient manner. Here’s a simple and common Git workflow: