{"id":1264,"date":"2019-10-29T22:43:56","date_gmt":"2019-10-29T15:43:56","guid":{"rendered":"https:\/\/www.linuxid.net\/post\/?p=1264"},"modified":"2025-04-18T15:21:34","modified_gmt":"2025-04-18T08:21:34","slug":"cara-menambahkan-git-remote-baru","status":"publish","type":"post","link":"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/","title":{"rendered":"Cara Menambahkan Git Remote Baru"},"content":{"rendered":"<p>Biasanya, saat bekerja dengan Git, Anda hanya akan menggunakan satu remote bernama origin dan branches yang berbeda untuk berbagai fitur dan environments. Origin adalah nama remote yang secara otomatis dibuat ketika Anda mengkloning repositori dan menunjuk ke repositori yang dikloning.<\/p>\n<p>Namun, ketika berkolaborasi pada proyek dengan sekelompok orang, Anda mungkin menemukan menggunakan beberapa remote Git sangat berguna.<\/p>\n<p>Git remote adalah petunjuk ke versi repositori yang biasanya disimpan di server lain.<\/p>\n<p>Panduan ini menjelaskan cara menambahkan Git remote baru.<\/p>\n<h2>Menambahkan Remote Git<\/h2>\n<p>remote repository harus ada sebelum menambahkan remote git ke repositori lokal. Anda dapat membuat repositori pada layanan hosting Git seperti GitHub, GitLab, dan BitBucket atau di <a href=\"https:\/\/www.linuxid.net\/post\/tutorial-membuat-dan-konfigurasi-git-server\/\">server private\u00a0Git<\/a> Anda.<\/p>\n<p>Untuk menambahkan remote baru, <a href=\"https:\/\/www.linuxid.net\/post\/tutorial-penggunaan-perintah-cd-di-terminal-linux\/\">navigasikan ke direktori<\/a> tempat penyimpanan Anda dan gunakan perintah <code>git remote add<\/code> diikuti dengan nama remote, dan URL remote:<\/p>\n<pre>git remote add &lt;remote-name&gt; &lt;remote-url&gt;<\/pre>\n<p>Misalnya, untuk menambahkan remote baru bernama\u00a0<code>staging<\/code>\u00a0 yang menunjuk ke <code><a href=\"https:\/\/www.linuxid.net\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"791e100d391e100d0a1c0b0f1c0b571a1614\">[email\u00a0protected]<\/a>:user\/repo_name.git<\/code>\u00a0, maka Anda akan mengetik:<\/p>\n<pre>git remote add staging <a href=\"https:\/\/www.linuxid.net\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"95f2fce1d5f2fce1e6f0e7e3f0e7bbf6faf8\">[email\u00a0protected]<\/a>:user\/repo_name.git<\/pre>\n<p>Gunakan perintah <code>git remote<\/code> untuk melihat list koneksi jarak jauh dan verifikasi bahwa remote baru berhasil ditambahkan:<\/p>\n<pre>git remote -v<\/pre>\n<p>Outputnya akan terlihat seperti ini :<\/p>\n<pre>origin\thttps:\/\/github.com\/user\/repo_name.git (fetch)&#13;\norigin\thttps:\/\/github.com\/user\/repo_name.git (push)&#13;\nstaging\t<a href=\"https:\/\/www.linuxid.net\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"84e3edf0c4e3edf0f7e1f6f2e1f6aae7ebe9\">[email\u00a0protected]<\/a>:user\/repo_name.git (fetch)&#13;\nstaging\t<a href=\"https:\/\/www.linuxid.net\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"f5929c81b5929c81869087839087db969a98\">[email\u00a0protected]<\/a>:user\/repo_name.git (push)&#13;\n<\/pre>\n<p>Apa yang sebenarnya dilakukan perintah <code>git remote add<\/code> adalah memodifikasi file\u00a0repositori <code>.git\/config<\/code>\u00a0dan koneksi baru ke repositori remote.<\/p>\n<pre>...&#13;\n&#13;\n[remote \"staging\"]&#13;\n        url = <a href=\"https:\/\/www.linuxid.net\/cdn-cgi\/l\/email-protection\" class=\"__cf_email__\" data-cfemail=\"e5828c91a5828c91968097938097cb868a88\">[email\u00a0protected]<\/a>:user\/repo_name.git&#13;\n        fetch = +refs\/heads\/*:refs\/remotes\/staging\/*&#13;\n<\/pre>\n<p>Anda dapat menambahkan remote baru dengan mengedit file <code>.git\/config<\/code> dengan <a href=\"https:\/\/www.linuxid.net\/post\/cara-menggunakan-text-editor-nano-di-baris-perintah-linux\/\">teks editor<\/a>, tetapi menggunakan perintah <code>git remote add<\/code> jauh lebih mudah.<\/p>\n<p>Pada point Anda telah berhasil menambahkan Git remote baru.<\/p>\n<p>Untuk push kode ke remote baru,\u00a0 gunakan perintah berikut :<\/p>\n<pre>git push &lt;remote-name&gt; &lt;branch-name&gt;<\/pre>\n<p>Untuk fetch dan pull dari remote gunakan perintah berikut :<\/p>\n<pre>git fetch &lt;remote-name&gt;git pull &lt;remote-name&gt;<\/pre>\n<h2>Kesimpulan<\/h2>\n<p>Menambahkan Git remote baru hanya ada satu perintah. Git remote sangat berguna dan memungkinkan Anda memiliki beberapa repositori.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Biasanya, saat bekerja dengan Git, Anda hanya akan menggunakan satu remote bernama origin dan branches&hellip;<\/p>\n","protected":false},"author":2,"featured_media":1265,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[107],"tags":[125],"class_list":["post-1264","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-other","tag-git"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cara Menambahkan Git Remote Baru - Linuxid<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/\" \/>\n<meta property=\"og:locale\" content=\"id_ID\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cara Menambahkan Git Remote Baru - Linuxid\" \/>\n<meta property=\"og:description\" content=\"Biasanya, saat bekerja dengan Git, Anda hanya akan menggunakan satu remote bernama origin dan branches&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/\" \/>\n<meta property=\"og:site_name\" content=\"Linuxid\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-29T15:43:56+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-18T08:21:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Menambahkan-Git-Remote.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"530\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"xsand\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Ditulis oleh\" \/>\n\t<meta name=\"twitter:data1\" content=\"xsand\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimasi waktu membaca\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 menit\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/\",\"url\":\"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/\",\"name\":\"Cara Menambahkan Git Remote Baru - Linuxid\",\"isPartOf\":{\"@id\":\"https:\/\/linuxid.net\/post\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Menambahkan-Git-Remote.jpg\",\"datePublished\":\"2019-10-29T15:43:56+00:00\",\"dateModified\":\"2025-04-18T08:21:34+00:00\",\"author\":{\"@id\":\"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/#breadcrumb\"},\"inLanguage\":\"id\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/#primaryimage\",\"url\":\"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Menambahkan-Git-Remote.jpg\",\"contentUrl\":\"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Menambahkan-Git-Remote.jpg\",\"width\":1000,\"height\":530},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Beranda\",\"item\":\"https:\/\/linuxid.net\/post\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cara Menambahkan Git Remote Baru\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/linuxid.net\/post\/#website\",\"url\":\"https:\/\/linuxid.net\/post\/\",\"name\":\"Linuxid\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/linuxid.net\/post\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"id\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79\",\"name\":\"xsand\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"id\",\"@id\":\"https:\/\/linuxid.net\/post\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g\",\"caption\":\"xsand\"},\"url\":\"https:\/\/www.linuxid.net\/post\/author\/xsand\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cara Menambahkan Git Remote Baru - Linuxid","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/","og_locale":"id_ID","og_type":"article","og_title":"Cara Menambahkan Git Remote Baru - Linuxid","og_description":"Biasanya, saat bekerja dengan Git, Anda hanya akan menggunakan satu remote bernama origin dan branches&hellip;","og_url":"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/","og_site_name":"Linuxid","article_published_time":"2019-10-29T15:43:56+00:00","article_modified_time":"2025-04-18T08:21:34+00:00","og_image":[{"width":1000,"height":530,"url":"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Menambahkan-Git-Remote.jpg","type":"image\/jpeg"}],"author":"xsand","twitter_card":"summary_large_image","twitter_misc":{"Ditulis oleh":"xsand","Estimasi waktu membaca":"2 menit"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/","url":"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/","name":"Cara Menambahkan Git Remote Baru - Linuxid","isPartOf":{"@id":"https:\/\/linuxid.net\/post\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/#primaryimage"},"image":{"@id":"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Menambahkan-Git-Remote.jpg","datePublished":"2019-10-29T15:43:56+00:00","dateModified":"2025-04-18T08:21:34+00:00","author":{"@id":"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79"},"breadcrumb":{"@id":"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/#breadcrumb"},"inLanguage":"id","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/"]}]},{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/#primaryimage","url":"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Menambahkan-Git-Remote.jpg","contentUrl":"https:\/\/www.linuxid.net\/post\/wp-content\/uploads\/2025\/03\/Cara-Menambahkan-Git-Remote.jpg","width":1000,"height":530},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxid.net\/post\/cara-menambahkan-git-remote-baru\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Beranda","item":"https:\/\/linuxid.net\/post\/"},{"@type":"ListItem","position":2,"name":"Cara Menambahkan Git Remote Baru"}]},{"@type":"WebSite","@id":"https:\/\/linuxid.net\/post\/#website","url":"https:\/\/linuxid.net\/post\/","name":"Linuxid","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxid.net\/post\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"id"},{"@type":"Person","@id":"https:\/\/linuxid.net\/post\/#\/schema\/person\/e6642d26041eab9fef2677e204e89d79","name":"xsand","image":{"@type":"ImageObject","inLanguage":"id","@id":"https:\/\/linuxid.net\/post\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cc8513768e15fa0758099a0ba5b898f3?s=96&d=mm&r=g","caption":"xsand"},"url":"https:\/\/www.linuxid.net\/post\/author\/xsand\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts\/1264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/comments?post=1264"}],"version-history":[{"count":1,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts\/1264\/revisions"}],"predecessor-version":[{"id":2786,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/posts\/1264\/revisions\/2786"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/media\/1265"}],"wp:attachment":[{"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/media?parent=1264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/categories?post=1264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxid.net\/post\/wp-json\/wp\/v2\/tags?post=1264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}