Git status Command
In this page:
git status
git status -s
git status क्या है?
git status Git का core diagnostic command है -- इसे तब चलाएँ जब आपको sure न हो कि आपका project किस state में है, और यह हर उस file को list करेगा जो last commit के बाद untracked, staged, या modified है, सब एक readable summary में।
उदाहरण: What is git status?
git status
Untracked Status पढ़ना
Project folder के अंदर आपने अभी जो files बनाई हैं वे Untracked की तरह दिखती हैं -- Git ने notice किया है कि वे exist करती हैं लेकिन deliberately उनके contents को ignore कर रहा है जब तक आप explicitly उन्हें git add न करें, ताकि accidental files कभी history में न घुसें।
उदाहरण: Reading Untracked Status
echo "new content" > newfile.txt
git status
Staged Status पढ़ना
'Changes to be committed' के तहत listed files staging area में बैठी हैं, यानी अगली बार जब आप git commit चलाएँ उनकी current state exactly as-is capture हो जाएगी -- commit करने से पहले confirm करने के लिए यह check करने वाला section है कि आप वही save कर रहे हैं जो आप चाहते थे।
उदाहरण: Reading Staged Status
git add newfile.txt
git status
Modified Status पढ़ना
'Changes not staged for commit' के तहत files वे हैं जिन्हें Git पहले से track करता है और जिन्हें आपने बाद में modify किया है -- staged version और working-directory version अब अलग हैं, और staged की गई चीज़ update करने के लिए आपको दोबारा git add चलाना होगा।
उदाहरण: Reading Modified Status
echo "more text" >> tracked.txt
git status
Shorthand Status Check
कई बदली हुई files वाले एक बड़े project के लिए, पूरा git status output overwhelming हो सकता है -- git status -s (या --short) हर file को एक two-letter status code के साथ एक single line में compress करता है, इसे scan करना कहीं तेज़ बनाते हुए।
उदाहरण: Shorthand Status Check
git status -s
git statusको committed history दिखाते हुए पढ़ना, जबकि यह सिर्फ untracked, modified और staged files की current state दिखाता है।- 'Changes to be committed' और 'Changes not staged for commit' दो lists notice न करना, ताकि एक modified file को staged मान लिया जाए जब यह नहीं है।
- Git द्वारा print किया गया hint text ignore करना, जैसे
use "git restore --staged <file>", जो exactly बताता है कि एक step कैसे undo करें।
Chapter Quiz — Complete all 18 topics to unlock
0/18 topics done
Complete these topics first:
- Git init Command
- Git New Files
- Git Staging Environment
- Git clone Command
- Git status Command
- Git help Command
- Git add Command
- Git commit Command
- Git tags Command
- Git stash Command
- Git log Command
- Git diff Command
- Git show Command
- Git rm Command
- Git mv Command
- Git restore Command
- Git clean Command
- Git ignore (.gitignore)