Basic Commands Guide

Q1. Make your first project

Ans.
Select Dir Wherr you create Project

Terminal
mkdir my-first-project
cd my-first-project
git init
Note
What happened?

mkdir made a new folder
cd went inside that folder
git init told Git: “start tracking this folder”

Q2. Create a file and save a version

Ans.
Create a file:
echo "Hello Git" > hello.txt

Now check the status:
Setup Run : git status
Git will say hello.txt is untracked (Git sees it but is not saving it yet).

Now do the two-step save:
Setup Run : git add hello.txt , git commit -m "My first commit"

Terminal
git status

git add hello.txt
git commit -m "My first commit"
Note
git add = choose what you want to save (like putting items in a box)
git commit = actually save it with a message (like sealing the box and writing a label)

🎉 You just made your first commit!

Q3. See your history

Ans.
You will see your commit with your message, name, and date.

Terminal
git log
Note
The basic cycle (remember this!)
Change your files
git add . (the dot means “all changed files”)
git commit -m "describe what you changed"

That’s 80% of daily Git use.

Q4. Quick cheat sheet

Ans.
Start Git in a folder
Setup Run : git init

See what changed
Setup Run : git status

Choose all changes to save
Setup Run : git add .

Save a version
Setup Run : git commit -m "msg"

See history
Setup Run : git log

Terminal
git init

git status

git add .

git commit -m "msg"

git log

Welcome back