git pull
git
इस्तेमाल
git pull [--rebase|--ff-only] [<remote> <branch>]fetch और merge को एक ही बार में करता है, यहीं से अनचाहे merge commit आते हैं; --rebase या --ff-only उन्हें रोकता है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| --rebase | replay your commits on top instead of merging |
| --ff-only | refuse if a merge commit would be needed |
| --no-rebase | merge, whatever pull.rebase says |
| --autostash | park local changes for the duration |
| --prune | drop tracking refs for deleted branches |
| --depth <n> | shallow pull |
उदाहरण
git pull --rebase origin mainbrings in server commits and puts yours on top
git pull --ff-onlyupdates only when nothing has to be merged
git pull --autostashpulls even with uncommitted changes in the way
उलझन यह है कि पीछे लौटने के कई रूप हैं — ब्रांच का इशारा हटाना और उलटने वाला कमिट जोड़ना एक बात नहीं।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. git pull क्या करता है?
fetch और merge को एक ही बार में करता है, यहीं से अनचाहे merge commit आते हैं; --rebase या --ff-only उन्हें रोकता है।
Q. इसे कैसे लिखें?
git pull [--rebase|--ff-only] [<remote> <branch>] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 6 दिए हैं; पूरी सूची man git में है। यह कमांड git में आती है।
मिलती-जुलती कमांड
man पेज: man git-pull