git stash
git
इस्तेमाल
git stash [push] [-u] [-m "<message>"]अधूरे बदलाव किनारे रखकर पेड़ साफ़ कर देता है; untracked फ़ाइलें -u के बिना पीछे छूट जाती हैं, और pop प्रविष्टि हटा देता है जबकि apply उसे रखता है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -u | include untracked files, which are otherwise left behind |
| -a | include ignored files too |
| -k | keep the staging area as it is |
| -p | stash selected hunks |
| pop | apply the newest entry and delete it |
| apply | apply it and keep the entry |
| list | show the entries |
| drop <stash> | delete one entry |
उदाहरण
git stash -u -m "wip login"parks tracked and untracked changes under a name
git stash popbrings the newest stash back and removes it from the list
git stash apply stash@{2}applies an older entry and leaves it in the list
उलझन यह है कि पीछे लौटने के कई रूप हैं — ब्रांच का इशारा हटाना और उलटने वाला कमिट जोड़ना एक बात नहीं।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. git stash क्या करता है?
अधूरे बदलाव किनारे रखकर पेड़ साफ़ कर देता है; untracked फ़ाइलें -u के बिना पीछे छूट जाती हैं, और pop प्रविष्टि हटा देता है जबकि apply उसे रखता है।
Q. इसे कैसे लिखें?
git stash [push] [-u] [-m "<message>"] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 8 दिए हैं; पूरी सूची man git में है। यह कमांड git में आती है।
मिलती-जुलती कमांड
man पेज: man git-stash