Git remote Command
In this page:
git remote
git remote add remote_name repository_url
git remote rename old_name new_name
git remote remove remote_name
Remotes List करना
अकेला git remote आपकी repository की जानी हर remote के short names list करता है (आमतौर पर सिर्फ origin); हर name जिस actual URL की ओर point करता है वह भी देखने के लिए -v add करें, fetch और push दोनों के लिए।
उदाहरण: Listing Remotes
git remote
git remote -v
एक Remote Add करना
git remote add <name> <url> आपकी repository को default origin से आगे एक additional remote से connect करता है -- original project के साथ-साथ एक personal fork के साथ collaborate करते समय, या same code को दो अलग hosts पर deploy करते समय उपयोगी।
उदाहरण: Adding a Remote
git remote add upstream https://github.com/original/repo.git
Remotes Rename और Remove करना
git remote rename <old> <new> और git remote remove <name> आपको उन remote connections को साफ करने देते हैं जिनकी अब ज़रूरत नहीं या जिनका नाम गलत रखा गया, आपकी actual commit history को affect किए बिना।
उदाहरण: Renaming and Removing Remotes
git remote rename origin old-origin
git remote remove old-origin
Remote URLs बदलना
अगर एक repository एक नए host में migrate होती है या आपका username बदल जाता है, git remote set-url <name> <new-url> बिना remove और re-add किए यह update करता है कि एक मौजूदा remote कहाँ point करता है।
उदाहरण: Changing Remote URLs
git remote set-url origin https://github.com/newuser/repo.git
Detailed Remote Information दिखाना
git remote show <name> एक specific remote के बारे में detailed information print करता है -- इसका URL, यह कौन सी branches track करता है, और आपकी local branches अपने remote counterparts से ahead, behind, या diverged हैं या नहीं।
उदाहरण: Showing Detailed Remote Information
git remote show origin
- URL में एक typo के साथ एक remote add करना, ताकि
git pushfail हो, जबकिgit remote -vदिखाता है कि क्या configured है। - पहले से
originexist करते हुएgit remote add origin ...चलाना, जोremote origin already existsदेता है। - यह भूल जाना कि
git remote renameसे एक remote rename करना इसकी remote-tracking branches के names भी बदल देता है।
Chapter Quiz — Complete all 11 topics to unlock
0/11 topics done
Complete these topics first: