Skip to content
Home Tutorials Roadmaps Courses
Log in Join free
Tutorials Git What is Git?
Git Beginner FREE

What is Git?

Lesson 1 of 17 Beginner Interactive

Git is a distributed version control system. It tracks changes in your code and allows collaboration.

Why Git?

  • Track every change
  • Branch and merge
  • Collaborate with teams
  • Roll back mistakes

Syntax

GIT
git init
git add .
git commit -m "Initial commit"
git push origin main
Git Basic Commands
BASH
# Initialize a new repository
git init

# Check status
git status

# Stage files
git add .
git add filename.txt

# Commit
git commit -m "Initial commit"

# View log
git log --oneline

Practice

1
Exercise

What command initializes a new Git repository?

Answer
git init

Quick Quiz

1

What does "git add" do?

git add stages changes for the next commit.

Interview Questions

git fetch downloads changes but doesn't merge. git pull fetches and merges in one command.