{"id":340,"date":"2025-07-03T00:00:30","date_gmt":"2025-07-02T15:00:30","guid":{"rendered":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/?p=340"},"modified":"2026-06-13T01:23:56","modified_gmt":"2026-06-12T16:23:56","slug":"git-github-repo","status":"publish","type":"post","link":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/2025\/07\/03\/git-github-repo\/","title":{"rendered":"Git &amp; GitHub \u65b0\u898f\u30ea\u30dd\u30b8\u30c8\u30ea\u4f5c\u6210"},"content":{"rendered":"<p>\u3053\u306e\u30da\u30fc\u30b8\u3067\u306f\u3001GitHub\u3067\u306e\u65b0\u898f\u30ea\u30dd\u30b8\u30c8\u30ea\u4f5c\u6210\u304b\u3089\u3001\u30ed\u30fc\u30ab\u30eb\u3067\u306e\u521d\u671f\u8a2d\u5b9a\u3001\u521d\u56de\u30d7\u30c3\u30b7\u30e5\u307e\u3067\u306e\u624b\u9806\u3092\u307e\u3068\u3081\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>1. GitHub\u3067\u65b0\u3057\u3044\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n<ul>\n<li>GitHub\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u53f3\u4e0a\u306e\u300c\uff0b\u300d\u2192\u300cNew repository\u300d\u3092\u30af\u30ea\u30c3\u30af<\/li>\n<li>\u30ea\u30dd\u30b8\u30c8\u30ea\u540d\u3092\u5165\u529b<\/li>\n<li>\u300cPublic\u300d\u307e\u305f\u306f\u300cPrivate\u300d\u3092\u9078\u629e<\/li>\n<li>\u300cCreate repository\u300d\u3092\u30af\u30ea\u30c3\u30af<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>2. \u30ed\u30fc\u30ab\u30eb\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067Git\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u521d\u671f\u5316\u3059\u308b<\/h2>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd \u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a9\u30eb\u30c0\u3000\u3000# \u3053\u306e\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5165\u308c\u307e\u3059\r\ngit init\r\n<\/pre>\n<h2>3. SSH\u8a8d\u8a3c\u306e\u5229\u7528\uff08\u521d\u56de\u306e\u307f\uff09<\/h2>\n<ol>\n<li>\u30bf\u30fc\u30df\u30ca\u30eb\uff08\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3084PowerShell\u306a\u3069\uff09\u3092\u958b\u304f<\/li>\n<li>\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067SSH\u9375\u3092\u751f\u6210\u3059\u308b\uff08\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306f\u81ea\u5206\u306e\u3082\u306e\u306b\u5909\u3048\u3066\u304f\u3060\u3055\u3044\uff09\uff1a<br \/>\n<code>ssh-keygen -t ed25519 -C \"your_email@example.com\"<\/code><\/li>\n<li>Enter\u30ad\u30fc\u3092\u62bc\u3057\u3066\u4fdd\u5b58\u5834\u6240\uff08\u901a\u5e38\u306f <code>~\/.ssh\/id_ed25519<\/code>\uff09\u3092\u6c7a\u5b9a\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\u3067OK\uff09<\/li>\n<li>\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba\u306e\u8a2d\u5b9a\u306f\u4efb\u610f\uff08\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u9ad8\u3081\u305f\u3044\u5834\u5408\u306f\u8a2d\u5b9a\u63a8\u5968\uff09<\/li>\n<li>\u9375\u304c\u751f\u6210\u3055\u308c\u308b\u3068\u3001\u516c\u958b\u9375\u306f <code>~\/.ssh\/id_ed25519.pub<\/code> \u306b\u4fdd\u5b58\u3055\u308c\u308b<\/li>\n<li>\u516c\u958b\u9375\u306e\u5185\u5bb9\u3092\u30b3\u30d4\u30fc\u3059\u308b\uff1a<br \/>\n<code>cat ~\/.ssh\/id_ed25519.pub<\/code><\/li>\n<li>GitHub\u306e\u300cSettings\u300d\u2192\u300cSSH and GPG keys\u300d\u2192\u300cNew SSH key\u300d\u304b\u3089\u516c\u958b\u9375\u3092\u767b\u9332\u3059\u308b<\/li>\n<\/ol>\n<p>\u3053\u308c\u3067\u3001\u4ee5\u964d\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u4e0d\u8981\u3067\u5b89\u5168\u306bpush\u3084pull\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>4. GitHub\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30ea\u30e2\u30fc\u30c8\u306b\u8ffd\u52a0\u3059\u308b<\/h2>\n<p>\uff08\u521d\u56de\uff09<code>git remote add origin git@github.com:(\u30e6\u30fc\u30b6\u30fc\u540d)\/(\u30ea\u30dd\u30b8\u30c8\u30ea\u540d)<\/code><br \/>\n\uff08URL\u5909\u66f4\u6642\uff09<code>git remote set-url origin git@github.com:(\u30e6\u30fc\u30b6\u30fc\u540d)\/(\u30ea\u30dd\u30b8\u30c8\u30ea\u540d)<\/code><br \/>\n\u521d\u3081\u3066\u306e\u63a5\u7d9a\u6642\u306f\u300c\u63a5\u7d9a\u3092\u7d9a\u884c\u3057\u307e\u3059\u304b\uff1f\u300d\u3068\u805e\u304b\u308c\u308b\u306e\u3067\u300cyes\u300d\u3068\u5165\u529b<\/p>\n<p>\u63a8\u5968\u306f\u3067\u304d\u307e\u305b\u3093\u304c\uff0cHTTPS\u3067\u306e\u30d7\u30c3\u30b7\u30e5\u3092\u884c\u3046\u969b\u306b\u306f\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngit remote add origin https:\/\/github.com\/(\u30e6\u30fc\u30b6\u30fc\u540d)\/(\u30ea\u30dd\u30b8\u30c8\u30ea\u540d)\r\n<\/pre>\n<p>\u30d1\u30b9\u30ef\u30fc\u30c9\u8a8d\u8a3c\u304c\u5ec3\u6b62\u3055\u308c\u305f\u305f\u3081\u3001HTTPS\u3067\u306e\u30d7\u30c3\u30b7\u30e5\u6642\u306b\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u4ee3\u308f\u308a\u306bGitHub\u306e <a href=\"https:\/\/github.com\/settings\/tokens\" target=\"_blank\" rel=\"noopener noreferrer\">Personal Access Token<\/a> \u3092\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>5. \u30d5\u30a1\u30a4\u30eb\u3092\u30b9\u30c6\u30fc\u30b8\u3057\u3066\u30b3\u30df\u30c3\u30c8\u3059\u308b<\/h2>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngit add .\r\ngit commit -m &quot;\u30b3\u30e1\u30f3\u30c8\u3092\u8a18\u5165&quot;\r\n<\/pre>\n<p>\u30b9\u30c6\u30fc\u30b8\u3057\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30ea\u30bb\u30c3\u30c8\u3059\u308b<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngit reset\r\n<\/pre>\n<h2>6. GitHub\u3078\u30d7\u30c3\u30b7\u30e5\u3059\u308b<\/h2>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngit push -u origin master\r\n<\/pre>\n<p><strong>\u6ce8\u610f\uff1a<\/strong>GitHub\u306e\u8a8d\u8a3c\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u306f\u306a\u304f\u3001Personal Access Token\uff08PAT\uff09\u304bSSH\u30ad\u30fc\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u521d\u56de\u4ee5\u964d\u306f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30d7\u30c3\u30b7\u30e5\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ngit push\r\n<\/pre>\n<p>\ud83c\udf89\u3053\u308c\u3067\uff0cGit\u3068GitHub\u3092\u4f7f\u3063\u3066\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u304c\u3067\u304d\u307e\u3059\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5229\u7528\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u306e\u521d\u671f\u8a2d\u5b9a\u3092\u307e\u3068\u3081\u3066\u304a\u304d\u307e\u3059\uff0e<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"common","vkexunit_cta_each_option":"","_lightning_design_setting":{"layout":"default"},"footnotes":""},"categories":[1],"tags":[22,23],"class_list":["post-340","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-git","tag-github"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/wp-json\/wp\/v2\/posts\/340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/wp-json\/wp\/v2\/comments?post=340"}],"version-history":[{"count":11,"href":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/wp-json\/wp\/v2\/posts\/340\/revisions"}],"predecessor-version":[{"id":356,"href":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/wp-json\/wp\/v2\/posts\/340\/revisions\/356"}],"wp:attachment":[{"href":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/wp-json\/wp\/v2\/media?parent=340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/wp-json\/wp\/v2\/categories?post=340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sgt.tailc1292c.ts.net\/wordpress\/wp-json\/wp\/v2\/tags?post=340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}