git remote
git
इस्तेमाल
git remote -v | git remote add <name> <url>रिमोट repository के नाम और URL सँभालता है; यह उन्हें केवल दर्ज करता है, fetch या push करने तक कुछ आता-जाता नहीं।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -v | list the remotes with their URLs |
| add <name> <url> | register another repository |
| set-url <name> <url> | point an existing remote somewhere else |
| rename <old> <new> | rename a remote |
| remove <name> | forget a remote |
| show <name> | branches it has and how they are tracked |
| prune <name> | drop tracking refs for branches deleted there |
उदाहरण
git remote -vshows the fetch and push URL of every remote
git remote add upstream https://github.com/orig/repo.gitadds the original repo alongside your fork
git remote set-url origin git@github.com:me/repo.gitswitches origin from HTTPS to ssh
उलझन यह है कि पीछे लौटने के कई रूप हैं — ब्रांच का इशारा हटाना और उलटने वाला कमिट जोड़ना एक बात नहीं।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. git remote क्या करता है?
रिमोट repository के नाम और URL सँभालता है; यह उन्हें केवल दर्ज करता है, fetch या push करने तक कुछ आता-जाता नहीं।
Q. इसे कैसे लिखें?
git remote -v | git remote add <name> <url> — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 7 दिए हैं; पूरी सूची man git में है। यह कमांड git में आती है।
मिलती-जुलती कमांड
man पेज: man git-remote