{"id":2940,"date":"2019-02-04T10:17:23","date_gmt":"2019-02-04T01:17:23","guid":{"rendered":"https:\/\/www.chihayafuru.jp\/tech\/?p=2940"},"modified":"2019-03-22T22:15:43","modified_gmt":"2019-03-22T13:15:43","slug":"git-fatal-remote-origin-already-exists","status":"publish","type":"post","link":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/archives\/2940","title":{"rendered":"[git] fatal: remote origin already exists."},"content":{"rendered":"<h3>1. \u75c7\u72b6<\/h3>\n<p>git remote add \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u30a8\u30e9\u30fc\u3068\u306a\u308b\u3002<\/p>\n<pre class=\"lang:sh highlight:0 decode:true \" >$ git remote add origin https:\/\/JaneDoe@dev.azure.com\/JaneDoe\/MyRepository\/_git\/MyRepository\r\nfatal: remote origin already exists.<\/pre>\n<p><!--more--><\/p>\n<p>&nbsp;<\/p>\n<h3>2. \u89e3\u6c7a\u65b9\u6cd5<\/h3>\n<p>origin \u306e\u8a2d\u5b9a\u3092\u524a\u9664\u3059\u308b\u3002<\/p>\n<pre class=\"lang:sh highlight:0 decode:true \" >$ git remote rm origin\r\n\r\n$ git remote add origin xxxxx\r\n\r\n$ git push -u origin master<\/pre>\n<p>&nbsp;<\/p>\n<h3>3. \u539f\u56e0<\/h3>\n<p>remote origin \u306e\u8a2d\u5b9a\u304c .git\/config \u306b\u65e2\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"lang:sh highlight:0 decode:true \" >$ cat .git\/config\r\n[core]\r\n\r\n        ### \u4e2d\u7565 ###\r\n\r\n[remote \"origin\"]\r\n        url = https:\/\/JaneDoe@xxx.com\/JaneDoe\/my_repository.git\r\n        fetch = +refs\/heads\/*:refs\/remotes\/origin\/*<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1. \u75c7\u72b6 git remote add \u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u30a8\u30e9\u30fc\u3068\u306a\u308b\u3002 $ git remote add origin https:\/\/JaneDoe@dev.azure.com\/JaneDoe\/MyReposit [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[2],"class_list":["post-2940","post","type-post","status-publish","format-standard","hentry","category-memo","tag-git"],"_links":{"self":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/2940","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/comments?post=2940"}],"version-history":[{"count":4,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/2940\/revisions"}],"predecessor-version":[{"id":3007,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/posts\/2940\/revisions\/3007"}],"wp:attachment":[{"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/media?parent=2940"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/categories?post=2940"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chihayafuru.jp\/tech\/index.php\/wp-json\/wp\/v2\/tags?post=2940"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}