Skip to content

📊 git status — Git-āĻ āφāĻĒāύāĻžāϰ āĻ…āĻŦāĻ¸ā§āĻĨāĻžāύ āϜāĻžāύ⧁āύ ​

git status āĻ•āĻŽāĻžāĻ¨ā§āĻĄāϟāĻŋ Git āϰāĻŋāĻĒā§‹āϜāĻŋāϟāϰāĻŋāϰ āĻŦāĻ°ā§āϤāĻŽāĻžāύ āĻ…āĻŦāĻ¸ā§āĻĨāĻž āĻĻ⧇āĻ–āĻžāύ⧋āϰ āϜāĻ¨ā§āϝ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāĻž āĻšā§ŸāĨ¤ āĻāϟāĻŋ āφāĻĒāύāĻžāϕ⧇ āĻŦāϞ⧇ āĻĻā§‡ā§Ÿ:

  • āϕ⧋āύ āĻĢāĻžāχāϞ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāĻŋāϤ āĻšā§Ÿā§‡āϛ⧇
  • āϕ⧋āύ āĻĢāĻžāχāϞ āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻž āφāϛ⧇
  • āϕ⧋āύ āĻĢāĻžāχāϞ āĻāĻ–āύāĻ“ āĻ•āĻŽāĻŋāϟ āĻšā§ŸāύāĻŋ
  • āϕ⧋āύ āĻĢāĻžāχāϞ untracked (āύāϤ⧁āύ)

✅ āĻŽā§ŒāϞāĻŋāĻ• āĻ•āĻŽāĻžāĻ¨ā§āĻĄ ​

bash
git status
git status

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§§: āϏāĻŦāĻ•āĻŋāϛ⧁ āĻ āĻŋāĻ•āĻ āĻžāĻ• āφāϛ⧇ ​

bash
$ git status
On branch main
nothing to commit, working tree clean
$ git status
On branch main
nothing to commit, working tree clean

📌 āĻ…āĻ°ā§āĻĨ: āϕ⧋āύ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āύ⧇āχ, āϏāĻŦāĻ•āĻŋāϛ⧁ āĻ•āĻŽāĻŋāϟ āĻšā§Ÿā§‡ āϗ⧇āϛ⧇āĨ¤

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ⧍: āύāϤ⧁āύ āĻĢāĻžāχāϞ āϤ⧈āϰāĻŋ āĻ•āϰāĻž āĻšā§Ÿā§‡āϛ⧇ ​

bash
$ touch hello.txt
$ git status
On branch main

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    hello.txt

nothing added to commit but untracked files present
$ touch hello.txt
$ git status
On branch main

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    hello.txt

nothing added to commit but untracked files present

📌 āĻ…āĻ°ā§āĻĨ: hello.txt āύāϤ⧁āύ āĻĢāĻžāχāϞ, Git āĻāϟāĻŋ āĻŸā§āĻ°ā§āϝāĻžāĻ• āĻ•āϰāϛ⧇ āύāĻžāĨ¤

👉 āϏāĻŽāĻžāϧāĻžāύ:

bash
git add hello.txt
git add hello.txt

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§Š: āĻāĻ•āϟāĻŋ āĻĢāĻžāχāϞ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻšā§Ÿā§‡āϛ⧇ ​

bash
$ echo "new line" >> hello.txt
$ git status
On branch main
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
    modified:   hello.txt
$ echo "new line" >> hello.txt
$ git status
On branch main
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
    modified:   hello.txt

📌 āĻ…āĻ°ā§āĻĨ: āĻĢāĻžāχāϞāϟāĻŋ āφāϗ⧇ āĻŸā§āĻ°ā§āϝāĻžāĻ• āĻ•āϰāĻž āĻ›āĻŋāϞ, āĻ•āĻŋāĻ¨ā§āϤ⧁ āĻāĻ–āύ āύāϤ⧁āύ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻšā§Ÿā§‡āϛ⧇, āϝāĻž āĻāĻ–āύāĻ“ āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻž āĻšā§ŸāύāĻŋāĨ¤

👉 āϏāĻŽāĻžāϧāĻžāύ:

bash
git add hello.txt
git add hello.txt

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§Ē: āĻ¸ā§āĻŸā§‡āϜ āĻ“ āφāύāĻ¸ā§āĻŸā§‡āϜ āĻŽāĻŋāĻļā§āϰāĻŋāϤ āĻ…āĻŦāĻ¸ā§āĻĨāĻž ​

bash
$ git add hello.txt
$ echo "another line" >> hello.txt
$ git status
On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    modified:   hello.txt

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
    modified:   hello.txt
$ git add hello.txt
$ echo "another line" >> hello.txt
$ git status
On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    modified:   hello.txt

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
    modified:   hello.txt

📌 āĻ…āĻ°ā§āĻĨ: āĻ•āĻŋāϛ⧁ āĻ…āĻ‚āĻļ āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻž āĻšā§Ÿā§‡āϛ⧇, āφāĻŦāĻžāϰ āĻ•āĻŋāϛ⧁ āĻ…āĻ‚āĻļ unstaged āφāϛ⧇āĨ¤

👉 āĻĻ⧇āĻ–āϤ⧇ āϚāĻžāχāϞ⧇:

bash
git diff hello.txt       # unstaged changes
git diff --staged        # staged changes
git diff hello.txt       # unstaged changes
git diff --staged        # staged changes

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§Ģ: āĻ…āύ⧇āĻ•āϗ⧁āϞ⧋ āĻĢāĻžāχāϞ āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ ​

bash
$ git status
On branch main
Changes not staged for commit:
    modified:   index.html
    modified:   app.js

Untracked files:
    new-script.js
$ git status
On branch main
Changes not staged for commit:
    modified:   index.html
    modified:   app.js

Untracked files:
    new-script.js

📌 āĻ…āĻ°ā§āĻĨ: index.html āĻ“ app.js āĻĢāĻžāχāϞ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāĻŋāϤ āĻšā§Ÿā§‡āϛ⧇, āĻāĻŦāĻ‚ new-script.js āύāϤ⧁āύ āĻĢāĻžāχāϞāĨ¤

👉 āĻ•āϰāĻŖā§€ā§Ÿ:

bash
git add index.html app.js new-script.js
git commit -m "Updated HTML and JS, added new script"
git add index.html app.js new-script.js
git commit -m "Updated HTML and JS, added new script"

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§Ŧ: āĻĢāĻžāχāϞ āĻĄāĻŋāϞāĻŋāϟ āĻ•āϰāĻž āĻšā§Ÿā§‡āϛ⧇ ​

bash
$ rm old-file.txt
$ git status
On branch main
Changes not staged for commit:
    deleted:    old-file.txt
$ rm old-file.txt
$ git status
On branch main
Changes not staged for commit:
    deleted:    old-file.txt

📌 āĻ…āĻ°ā§āĻĨ: old-file.txt āĻĢāĻžāχāϞāϟāĻŋ āĻĄāĻŋāϞāĻŋāϟ āĻ•āϰāĻž āĻšā§Ÿā§‡āϛ⧇, āĻ•āĻŋāĻ¨ā§āϤ⧁ Git āϜāĻžāύ⧇ āύāĻžāĨ¤

👉 āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāϤ⧇:

bash
git add -u
# āĻ…āĻĨāĻŦāĻž
git rm old-file.txt
git add -u
# āĻ…āĻĨāĻŦāĻž
git rm old-file.txt

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§­: āĻĢāĻžāχāϞ āύāĻžāĻŽ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ (rename) ​

bash
$ git mv about.html about-us.html
$ git status
On branch main
Changes to be committed:
    renamed:    about.html -> about-us.html
$ git mv about.html about-us.html
$ git status
On branch main
Changes to be committed:
    renamed:    about.html -> about-us.html

📌 āĻ…āĻ°ā§āĻĨ: about.html āĻĢāĻžāχāϞ⧇āϰ āύāĻžāĻŽ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻ•āϰāĻž āĻšā§Ÿā§‡āϛ⧇, āĻāĻŦāĻ‚ Git āĻāϟāĻŋ āĻŸā§āĻ°ā§āϝāĻžāĻ• āĻ•āϰāϛ⧇āĨ¤

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§Ž: .gitignore āĻ•āĻžāϜ āĻ•āϰāϛ⧇ āĻ•āĻŋ āύāĻž? ​

bash
$ echo "node_modules/" >> .gitignore
$ mkdir node_modules
$ git status
On branch main
nothing to commit, working tree clean
$ echo "node_modules/" >> .gitignore
$ mkdir node_modules
$ git status
On branch main
nothing to commit, working tree clean

📌 āĻ…āĻ°ā§āĻĨ: node_modules/ āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰ Git āχāĻ—āύ⧋āϰ āĻ•āϰāϛ⧇āĨ¤

🔍 git status āϕ⧇ āφāϰāĻ“ āϏāĻ‚āĻ•ā§āώ⧇āĻĒ⧇ āĻĻ⧇āĻ–āϤ⧇ āϚāĻžāύ? ​

āϏāĻžāĻœā§‡āĻ¸ā§āĻŸā§‡āĻĄ āĻĢā§āĻ˛ā§āϝāĻžāĻ—: -s āĻŦāĻž --short ​

bash
$ git status -s
 M index.html
?? new.txt
A  contact.html
$ git status -s
 M index.html
?? new.txt
A  contact.html
āĻĒā§āϰāϤ⧀āĻ•āĻ…āĻ°ā§āĻĨ
MModified (āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāĻŋāϤ)
AAdded (āĻ¸ā§āĻŸā§‡āϜāĻĄ āύāϤ⧁āύ āĻĢāĻžāχāϞ)
??Untracked file (āύāϤ⧁āύ)
DDeleted (āĻŽā§āϛ⧇ āĻĢ⧇āϞāĻž)

🧠 āϕ⧇āύ git status āĻāϤ āϜāϰ⧁āϰāĻŋ? ​

  • āϕ⧀ āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻž āĻšā§Ÿā§‡āϛ⧇ āφāϰ āϕ⧀ āĻšā§ŸāύāĻŋ — āϏāĻšāĻœā§‡ āĻĻ⧇āĻ–āĻž āϝāĻžā§Ÿ
  • āϭ⧁āϞ āĻ•āϰ⧇ āĻ•āĻŋāϛ⧁ āĻŦāĻžāĻĻ āĻĒā§œā§‡āϛ⧇ āĻ•āĻŋ āύāĻž — āĻŦ⧁āĻā§‡ āĻĢ⧇āϞāĻž āϝāĻžā§Ÿ
  • .gitignore āĻ āĻŋāĻ• āĻŽāϤ⧋ āĻ•āĻžāϜ āĻ•āϰāϛ⧇ āĻ•āĻŋ āύāĻž āϝāĻžāϚāĻžāχ āĻ•āϰāĻž āϝāĻžā§Ÿ

đŸ› ī¸ āĻĒā§āϰāĻžāĻ•āϟāĻŋāϏ⧇āϰ āϜāĻ¨ā§āϝ āĻĒāϰāĻžāĻŽāĻ°ā§āĻļ ​

  1. āύāϤ⧁āύ āĻĢāĻžāχāϞ āϤ⧈āϰāĻŋ āĻ•āϰ⧇ āĻĻ⧇āϖ⧁āύ git status āĻ•āĻŋāĻ­āĻžāĻŦ⧇ āϰāĻŋāĻĒā§‹āĻ°ā§āϟ āĻ•āϰ⧇
  2. āĻāĻ•āχ āĻĢāĻžāχāϞ⧇ āĻāĻ•āĻžāϧāĻŋāĻ• āĻŦāĻžāϰ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻ•āϰ⧇ āĻ¸ā§āĻŸā§‡āϜ āĻ“ unstaged āĻ…āĻŦāĻ¸ā§āĻĨāĻž āĻŦ⧁āĻā§āύ
  3. āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰ⧇ āφāĻŦāĻžāϰ git restore --staged āĻĻāĻŋā§Ÿā§‡ āĻ¸ā§āĻŸā§‡āϜ āĻŽā§āϛ⧇ āĻĻāĻŋāύ
  4. .gitignore āĻĢāĻžāχāϞ āĻĻāĻŋā§Ÿā§‡ āĻ•āĻŋāϛ⧁ āĻĢāĻžāχāϞ āĻŦāĻžāĻĻ āĻĻāĻŋāύ

đŸŽ¯ āϏāĻ‚āĻ•ā§āώ⧇āĻĒ⧇ āĻŽāύ⧇ āϰāĻžāϖ⧁āύ ​

āĻ…āĻŦāĻ¸ā§āĻĨāĻžgit status āĻ āϕ⧀ āĻĻ⧇āĻ–āĻžā§Ÿ
āύāϤ⧁āύ āĻĢāĻžāχāϞUntracked files
āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāĻŋāϤ āĻ•āĻŋāĻ¨ā§āϤ⧁ unstagedChanges not staged for commit
āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻž āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύChanges to be committed
āĻĢāĻžāχāϞ āĻŽā§āϛ⧇ āĻĢ⧇āϞāĻždeleted:
āĻĢāĻžāχāϞ āϰāĻŋāύ⧇āĻŽ āĻ•āϰāĻžrenamed:

🔚 āωāĻĒāϏāĻ‚āĻšāĻžāϰ ​

git status āĻšāϞ⧋ āφāĻĒāύāĻžāϰ Git āĻĒā§āϰāĻœā§‡āĻ•ā§āĻŸā§‡āϰ āĻŦāĻ°ā§āϤāĻŽāĻžāύ āϚāĻŋāĻ¤ā§āϰāĨ¤ āĻāϟāĻŋ āύāĻŋ⧟āĻŽāĻŋāϤ āϚāĻžāϞāĻŋā§Ÿā§‡ āϗ⧇āϞ⧇ āϭ⧁āϞ āĻ•āĻŽ āĻšāĻŦ⧇, āϏāĻŽā§Ÿ āĻŦāĻžāρāϚāĻŦ⧇, āĻāĻŦāĻ‚ āφāĻ¤ā§āĻŽāĻŦāĻŋāĻļā§āĻŦāĻžāϏ āĻŦāĻžā§œāĻŦ⧇āĨ¤

Released under the MIT License.