Skip to content

🔍 Checking Git Status ​

āĻĒā§āϰāϤāĻŋāĻĻāĻŋāύ⧇āϰ Git āĻŦā§āϝāĻŦāĻšāĻžāϰ⧇ āϏāĻŦāĻšā§‡ā§Ÿā§‡ āϗ⧁āϰ⧁āĻ¤ā§āĻŦāĻĒā§‚āĻ°ā§āĻŖ āĻ“ āύāĻŋāϰāĻžāĻĒāĻĻ āĻ…āĻ­ā§āϝāĻžāϏāϗ⧁āϞ⧋āϰ āĻāĻ•āϟāĻŋ āĻšāϞ⧋ git status āĻĻāĻŋā§Ÿā§‡ āφāĻĒāύāĻžāϰ āĻĒā§āϰāĻœā§‡āĻ•ā§āĻŸā§‡āϰ āĻ…āĻŦāĻ¸ā§āĻĨāĻž āĻšā§‡āĻ• āĻ•āϰāĻžāĨ¤

āĻāχ āĻĒāĻ°ā§āĻŦ⧇ āφāĻŽāϰāĻž āĻĻ⧇āĻ–āĻŦ āϕ⧀āĻ­āĻžāĻŦ⧇ Git āĻ¸ā§āĻŸā§āϝāĻžāϟāĻžāϏ āĻšā§‡āĻ• āĻ•āϰāϤ⧇ āĻšā§Ÿ, āĻāĻŦāĻ‚ āϤāĻžāϰ āĻĨ⧇āϕ⧇ āϕ⧀ āϤāĻĨā§āϝ āĻĒāĻžāĻ“ā§ŸāĻž āϝāĻžā§ŸāĨ¤

📌 āϕ⧇āύ git status āĻāϤ āϗ⧁āϰ⧁āĻ¤ā§āĻŦāĻĒā§‚āĻ°ā§āĻŖ? ​

  • āϕ⧋āύ āĻĢāĻžāχāϞāϗ⧁āϞ⧋ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāĻŋāϤ āĻšā§Ÿā§‡āϛ⧇ āĻĻ⧇āĻ–āϤ⧇
  • āϕ⧋āύāϗ⧁āϞ⧋ āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻž āĻšā§Ÿā§‡āϛ⧇, āϕ⧋āύāϗ⧁āϞ⧋ āĻšā§ŸāύāĻŋ āϤāĻž āĻŦ⧁āĻāϤ⧇
  • āύāϤ⧁āύ (untracked) āĻĢāĻžāχāϞāϗ⧁āϞ⧋ āϚāĻŋāĻšā§āύāĻŋāϤ āĻ•āϰāϤ⧇
  • āϭ⧁āϞ āĻ•āĻŽāĻŋāϟ āĻ•āϰāĻžāϰ āϏāĻŽā§āĻ­āĻžāĻŦāύāĻž āĻ•āĻŽāĻžāϤ⧇

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§§: āύāϤ⧁āύ āĻĒā§āϰāĻœā§‡āĻ•ā§āĻŸā§‡ āϕ⧋āύ⧋ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āύ⧇āχ ​

bash
$ git init
$ git status
On branch main
No commits yet
nothing to commit (create/copy files and use "git add" to track)
$ git init
$ git status
On branch main
No commits yet
nothing to commit (create/copy files and use "git add" to track)

📌 āĻ…āĻ°ā§āĻĨ: āĻāĻ–āύāĻ“ āϕ⧋āύ⧋ āĻĢāĻžāχāϞ āĻ…ā§āϝāĻžāĻĄ āĻŦāĻž āĻ•āĻŽāĻŋāϟ āĻ•āϰāĻž āĻšā§ŸāύāĻŋāĨ¤

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ⧍: āύāϤ⧁āύ āĻāĻ•āϟāĻŋ āĻĢāĻžāχāϞ āϤ⧈āϰāĻŋ āĻ•āϰāϞ⧇ āϕ⧀ āĻšā§Ÿ? ​

bash
$ echo "Hello Git" > hello.txt
$ git status
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    hello.txt
$ echo "Hello Git" > hello.txt
$ git status
Untracked files:
  (use "git add <file>..." to include in what will be committed)
    hello.txt

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

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

bash
git add hello.txt
git add hello.txt

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§Š: āĻĢāĻžāχāϞ āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻžāϰ āĻĒāϰ āϕ⧀ āĻĻ⧇āĻ–āĻžā§Ÿ? ​

bash
$ git add hello.txt
$ git status
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    new file:   hello.txt
$ git add hello.txt
$ git status
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    new file:   hello.txt

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

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§Ē: āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻžāϰ āĻĒāϰ āφāĻŦāĻžāϰ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻ•āϰāϞ⧇ āϕ⧀ āĻšā§Ÿ? ​

bash
$ echo "Another line" >> hello.txt
$ git status
Changes to be committed:
    new file:   hello.txt

Changes not staged for commit:
    modified:   hello.txt
$ echo "Another line" >> hello.txt
$ git status
Changes to be committed:
    new file:   hello.txt

Changes not staged for commit:
    modified:   hello.txt

📌 āĻāĻ• āĻĢāĻžāχāϞ⧇āχ āĻāĻ–āύ āĻĻ⧁āϟāĻŋ āĻ…āĻŦāĻ¸ā§āĻĨāĻž: āĻāĻ• āĻ…āĻ‚āĻļ āĻ¸ā§āĻŸā§‡āϜāĻĄ, āφāϰ⧇āĻ• āĻ…āĻ‚āĻļ unstagedāĨ¤

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§Ģ: āĻāĻ•āĻžāϧāĻŋāĻ• āĻĢāĻžāχāϞ āύāĻŋā§Ÿā§‡ āĻ•āĻžāϜ ​

bash
$ echo "A" > a.txt
$ echo "B" > b.txt
$ git add a.txt
$ git status
Changes to be committed:
    new file:   a.txt

Untracked files:
    b.txt
$ echo "A" > a.txt
$ echo "B" > b.txt
$ git add a.txt
$ git status
Changes to be committed:
    new file:   a.txt

Untracked files:
    b.txt

📌 a.txt āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻž āĻšā§Ÿā§‡āϛ⧇, b.txt āĻāĻ–āύāĻ“ untrackedāĨ¤

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§Ŧ: āĻĢāĻžāχāϞ āĻŽā§āϛ⧇ āĻĢ⧇āϞāϞ⧇ Git āϕ⧀ āĻĻ⧇āĻ–āĻžā§Ÿ? ​

bash
$ rm a.txt
$ git status
Changes not staged for commit:
    deleted:    a.txt
$ rm a.txt
$ git status
Changes not staged for commit:
    deleted:    a.txt

📌 Git āĻŦāϞāϛ⧇ — a.txt āĻĢāĻžāχāϞāϟāĻŋ āĻŽā§āϛ⧇ āĻĢ⧇āϞāĻž āĻšā§Ÿā§‡āϛ⧇, āĻ•āĻŋāĻ¨ā§āϤ⧁ āĻāϟāĻŋ āĻāĻ–āύāĻ“ āĻ•āĻŽāĻŋāϟ āĻšā§ŸāύāĻŋāĨ¤

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

bash
git add -u       # āϏāĻŦ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻŦ⧇
# āĻ…āĻĨāĻŦāĻž
git rm a.txt     # āĻāĻ•āϏāĻžāĻĨ⧇ āĻ¸ā§āĻŸā§‡āϜ āĻāĻŦāĻ‚ āĻĢāĻžāχāϞ āĻŽā§āϛ⧇ āĻĢ⧇āϞāĻŦ⧇
git add -u       # āϏāĻŦ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻŦ⧇
# āĻ…āĻĨāĻŦāĻž
git rm a.txt     # āĻāĻ•āϏāĻžāĻĨ⧇ āĻ¸ā§āĻŸā§‡āϜ āĻāĻŦāĻ‚ āĻĢāĻžāχāϞ āĻŽā§āϛ⧇ āĻĢ⧇āϞāĻŦ⧇

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§­: āĻĢāĻžāχāϞ āϰāĻŋāύ⧇āĻŽ āĻ•āϰāϞ⧇ ​

bash
$ git mv b.txt b-renamed.txt
$ git status
Changes to be committed:
    renamed:    b.txt -> b-renamed.txt
$ git mv b.txt b-renamed.txt
$ git status
Changes to be committed:
    renamed:    b.txt -> b-renamed.txt

📌 Git āύāĻŋāĻœā§‡ āĻŦ⧁āĻā§‡ āĻ¨ā§‡ā§Ÿ āĻāϟāĻŋ āĻāĻ•āϟāĻŋ āϰāĻŋāύ⧇āĻŽ āĻ…āĻĒāĻžāϰ⧇āĻļāύāĨ¤

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ā§Ž: .gitignore āĻĢāĻžāχāϞ āĻ•āĻžāϜ āĻ•āϰāϛ⧇ āĻ•āĻŋāύāĻž āĻĒāϰ⧀āĻ•ā§āώāĻž āĻ•āϰāĻž ​

bash
$ echo "logs/" > .gitignore
$ mkdir logs
$ touch logs/app.log
$ git status
nothing to commit, working tree clean
$ echo "logs/" > .gitignore
$ mkdir logs
$ touch logs/app.log
$ git status
nothing to commit, working tree clean

📌 āĻ…āĻ°ā§āĻĨ: .gitignore āĻ•āĻžāϜ āĻ•āϰāϛ⧇, āϤāĻžāχ logs/ āĻĢā§‹āĻ˛ā§āĻĄāĻžāϰ Git āχāĻ—āύ⧋āϰ āĻ•āϰāϛ⧇āĨ¤

đŸ§Ē āωāĻĻāĻžāĻšāϰāĻŖ ⧝: āϏāĻ‚āĻ•ā§āώāĻŋāĻĒā§āϤ (Short) āĻ¸ā§āĻŸā§āϝāĻžāϟāĻžāϏ āĻĻ⧇āĻ–āϤ⧇ ​

bash
$ git status -s
 M index.html
?? newfile.js
A  about.html
$ git status -s
 M index.html
?? newfile.js
A  about.html

📌 āϛ⧋āϟ āĻ•āϰ⧇ āĻĻ⧇āĻ–āĻž āϗ⧇āϞ⧇ āĻĻā§āϰ⧁āϤ āĻŦā§‹āĻāĻž āϝāĻžā§Ÿ āϕ⧋āύ āĻĢāĻžāχāϞ āϕ⧋āύ āĻ…āĻŦāĻ¸ā§āĻĨāĻžā§Ÿ āφāϛ⧇āĨ¤

āϚāĻŋāĻšā§āύāĻ…āĻ°ā§āĻĨ
MModified (āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāĻŋāϤ)
AAdded (āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰāĻž āĻšā§Ÿā§‡āϛ⧇)
??Untracked (āύāϤ⧁āύ āĻĢāĻžāχāϞ)

🧠 Git Status āĻĻ⧇āĻ–āĻž āĻāĻ•āϟāĻŋ āĻ…āĻ­ā§āϝāĻžāϏ⧇ āĻĒāϰāĻŋāĻŖāϤ āĻ•āϰ⧁āύ ​

āĻĒā§āϰāϤāĻŋ āϧāĻžāĻĒ⧇ git status āϚāĻžāϞāĻžāϞ⧇ āφāĻĒāύāĻŋ āϜāĻžāύāϤ⧇ āĻĒāĻžāϰāĻŦ⧇āύ:

āĻĒā§āϰāĻļā§āύāωāĻ¤ā§āϤāϰ
āϕ⧋āύ āĻĢāĻžāχāϞāϗ⧁āϞ⧋ āĻ•āĻŽāĻŋāϟ āĻšāĻŦ⧇?Changes to be committed: āϏ⧇āĻ•āĻļāύ āĻĻ⧇āϖ⧇ āĻŦ⧁āĻāĻŦ⧇āύ
āύāϤ⧁āύ āĻĢāĻžāχāϞ āĻ•āĻŋ āφāϛ⧇?Untracked files: āĻ…āĻ‚āĻļ⧇
āĻ¸ā§āĻŸā§‡āϜ āύāĻž āĻ•āϰāĻž āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ?Changes not staged for commit:
āĻ•āĻŋāϛ⧁ āϭ⧁āϞ āĻ•āϰ⧇ āĻĢ⧇āϞ⧇āĻ›āĻŋ?git restore āĻŦāĻž git reset āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰ⧇ āĻ āĻŋāĻ• āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŦ⧇āύ

💡 pro āϟāĻŋāĻĒāϏ ​

  • āĻļ⧁āϧ⧁ git status āύāĻž, āĻŽāĻžāĻā§‡ āĻŽāĻžāĻā§‡ git diff āĻĻāĻŋā§Ÿā§‡ āϞāĻžāχāύ⧇ āϞāĻžāχāύ⧇ āĻĒāĻžāĻ°ā§āĻĨāĻ•ā§āϝ āĻĻ⧇āϖ⧁āύ
  • āĻ…āύ⧇āĻ• āϏāĻŽā§Ÿ āϭ⧁āϞ āĻŦ⧁āĻā§‡ āĻ•āĻŋāϛ⧁ āĻĢāĻžāχāϞ āĻ¸ā§āĻŸā§‡āϜ āĻ•āϰ⧇ āĻĢ⧇āϞ⧇āύ — āϤāĻ–āύ git restore --staged <file> āĻ•āĻžāĻœā§‡ āφāϏ⧇
  • .gitignore āϤ⧈āϰāĻŋāϰ āĻĒāϰ⧇ āĻ¸ā§āĻŸā§āϝāĻžāϟāĻžāϏ āĻšā§‡āĻ• āĻ•āϰ⧇ āϝāĻžāϚāĻžāχ āĻ•āϰ⧁āύ āϏ⧇āϟāĻž āĻ•āĻžāϜ āĻ•āϰāϛ⧇ āĻ•āĻŋāύāĻž

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

git status āĻšāĻšā§āϛ⧇ Git āĻŦā§āϝāĻŦāĻšāĻžāϰāĻ•āĻžāϰ⧀āĻĻ⧇āϰ āϏāĻŦāĻšā§‡ā§Ÿā§‡ āĻŦāĻŋāĻļā§āĻŦāĻ¸ā§āϤ āϏāĻšāϚāϰāĨ¤ āĻāϟāĻŋ āϰ⧋āϜāĻ•āĻžāϰ āĻ•āĻžāĻœā§‡ āφāĻĒāύāĻžāϕ⧇ āϏāĻ āĻŋāĻ• āĻĻāĻŋāĻ• āĻĻ⧇āĻ–āĻžā§Ÿ āϝ⧇āύ āφāĻĒāύāĻŋ āϭ⧁āϞ āĻ•āĻŽāĻŋāϟ āĻŦāĻž āĻĄāĻŋāϞāĻŋāϟ āύāĻž āĻ•āϰ⧇āύāĨ¤ āĻĒā§āϰāϤāĻŋāϟāĻŋ āϧāĻžāĻĒ⧇āϰ āĻĒāϰ⧇ āĻāϟāĻŋ āϚāĻžāϞāĻžāύ⧋ āφāĻĒāύāĻžāϰ āĻĒā§āϰāĻœā§‡āĻ•ā§āϟāϕ⧇ āύāĻŋāϰāĻžāĻĒāĻĻ āϰāĻžāϖ⧇āĨ¤

Released under the MIT License.