{"id":1954,"date":"2026-04-11T20:00:00","date_gmt":"2026-04-11T11:00:00","guid":{"rendered":"https:\/\/syuji-engineer.com\/?p=1954"},"modified":"2026-04-11T16:08:42","modified_gmt":"2026-04-11T07:08:42","slug":"github%e3%81%ae%e8%aa%8d%e8%a8%bc%e3%81%a71%e6%99%82%e9%96%93%e8%a9%b0%e3%81%be%e3%81%a3%e3%81%9f%e8%a9%b1%e3%81%a8ssh%e8%a8%ad%e5%ae%9a%e3%81%ae%e8%a8%98%e9%8c%b2","status":"publish","type":"post","link":"https:\/\/syuji-engineer.com\/?p=1954","title":{"rendered":"GitHub\u306e\u8a8d\u8a3c\u30671\u6642\u9593\u8a70\u307e\u3063\u305f\u8a71\u3068SSH\u8a2d\u5b9a\u306e\u8a18\u9332"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>SSH\u8a8d\u8a3c\u306b\u5207\u308a\u66ff\u3048\u308b\u3068\u3001\u5168\u90e8\u89e3\u6c7a\u3057\u305f<\/strong><\/h3>\n\n\n\n<p>`git push` \u3067\u3064\u307e\u3063\u305f\u3068\u304d\u3001\u539f\u56e0\u304c1\u3064\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f3\u3064\u304c\u91cd\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>- \u300emacOS\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u306e\u53e4\u3044\u8a8d\u8a3c\u60c5\u5831\u300f\u304c\u90aa\u9b54\u3092\u3057\u3066\u3044\u305f<\/p>\n\n\n\n<p>- \u300e\u30c8\u30fc\u30af\u30f3URL\u306b\u7279\u6b8a\u6587\u5b57\u300f\u304c\u542b\u307e\u308c\u3066\u30b7\u30a7\u30eb\u304c\u8aa4\u4f5c\u52d5\u3057\u305f<\/p>\n\n\n\n<p>- \u300e\u30ea\u30dd\u30b8\u30c8\u30ea\u540d\u5909\u66f4\u5f8c\u306e\u30ea\u30e2\u30fc\u30c8URL\u66f4\u65b0\u5fd8\u308c\u300f\u304c\u91cd\u306a\u3063\u305f<\/p>\n\n\n\n<p>\u4f55\u3092\u8a66\u3057\u3066\u3082\u52b9\u304b\u306a\u304b\u3063\u305f\u7406\u7531\u306f\u3001\u554f\u984c\u30921\u3064\u305a\u3064\u6f70\u305d\u3046\u3068\u3057\u3066\u3044\u305f\u304b\u3089\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u89e3\u6c7a\u3057\u305f\u306e\u306f\u3001\u6839\u672c\u3092\u5909\u3048\u305f\u3068\u304d\u2014\u2014HTTPS\u304b\u3089SSH\u306b\u5207\u308a\u66ff\u3048\u305f\u77ac\u9593\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p>SSH\u8a2d\u5b9a\u306f5\u30b9\u30c6\u30c3\u30d7\u3067\u3059\u3002<\/p>\n\n\n\n<p>```bash<\/p>\n\n\n\n<p># 1. SSH\u30ad\u30fc\u3092\u751f\u6210\u3059\u308b<\/p>\n\n\n\n<pre class=\"wp-block-verse\">ssh-keygen -t ed25519 -C \"\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\" -f ~\/.ssh\/id_ed25519 -N \"\"<\/pre>\n\n\n\n<p># 2. \u516c\u958b\u9375\u3092\u8868\u793a\u3057\u3066\u30b3\u30d4\u30fc\u3059\u308b<\/p>\n\n\n\n<pre class=\"wp-block-verse\">cat ~\/.ssh\/id_ed25519.pub<\/pre>\n\n\n\n<p>3. GitHub\u306e\u8a2d\u5b9a\u753b\u9762\uff08Settings &gt; SSH and GPG keys &gt; New SSH key\uff09\u306b\u516c\u958b\u9375\u3092\u8cbc\u308a\u4ed8\u3051\u3066\u767b\u9332\u3059\u308b<\/p>\n\n\n\n<p>```bash<\/p>\n\n\n\n<p># 4. \u30ea\u30e2\u30fc\u30c8URL\u3092SSH\u5f62\u5f0f\u306b\u5909\u66f4\u3059\u308b<\/p>\n\n\n\n<pre class=\"wp-block-verse\">git remote set-url origin git@github.com:\u30e6\u30fc\u30b6\u30fc\u540d\/\u30ea\u30dd\u30b8\u30c8\u30ea\u540d.git<\/pre>\n\n\n\n<p># 5. \u63a5\u7d9a\u78ba\u8a8d<\/p>\n\n\n\n<pre class=\"wp-block-verse\">ssh -T git@github.com<br># Hi \u30e6\u30fc\u30b6\u30fc\u540d! You've successfully authenticated.<\/pre>\n\n\n\n<p>\u4e00\u5ea6\u8a2d\u5b9a\u3059\u308c\u3070\u3001\u4ee5\u964d\u306f `git push` \u3060\u3051\u3067\u5b8c\u4e86\u3057\u307e\u3059\u3002\u30c8\u30fc\u30af\u30f3\u306e\u5165\u529b\u306f\u4e0d\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>push\u3059\u308b\u3060\u3051\u306e\u306f\u305a\u304c\u30011\u6642\u9593\u683c\u95d8\u3057\u3066\u3044\u305f<\/strong><\/h3>\n\n\n\n<p>\u30d6\u30ed\u30b0\u8a18\u4e8b\u3092Markdown\u3067\u7ba1\u7406\u3059\u308b\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u540d\u3092 `my-blog` \u304b\u3089 `engineer-diary` \u306b\u5909\u3048\u3066\u3001GitHub\u306b\u30d7\u30c3\u30b7\u30e5\u3057\u3088\u3046\u3068\u3057\u305f\u3002\u305d\u308c\u3060\u3051\u306e\u3064\u3082\u308a\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3068\u3053\u308d\u304c\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u306b\u8d64\u3044\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u305f\u3073\u306b\u8abf\u3079\u3066\u3001\u8a66\u3057\u3066\u3001\u307e\u305f\u5225\u306e\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3002<\/p>\n\n\n\n<p>\u300c\u306a\u3093\u3067\u52d5\u304b\u306a\u3044\u3093\u3060\u300d\u3068\u601d\u3044\u306a\u304c\u3089\u3001\u6c17\u3065\u3044\u305f\u30891\u6642\u9593\u7d4c\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u539f\u56e0\u306f1\u3064\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3\u3064\u306e\u30a8\u30e9\u30fc\u304c\u91cd\u306a\u3063\u3066\u3044\u305f<\/strong><\/h3>\n\n\n\n<p><strong>\u3072\u3068\u3064\u3081\u306f\u3001\u300emacOS\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u306e\u53e4\u3044\u8a8d\u8a3c\u60c5\u5831\u300f\u3067\u3059\u3002<\/strong><\/p>\n\n\n\n<p>GitHub\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u306e\u30ed\u30b0\u30a4\u30f3\u3092\u5ec3\u6b62\u3057\u3066\u3044\u307e\u3059\u3002\u4ee3\u308f\u308a\u306b\u300ePAT\uff08\u500b\u4eba\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\uff09\u300f\u304c\u5fc5\u8981\u3067\u3059\u3002\u3068\u3053\u308d\u304cmacOS\u306e\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u306b\u306f\u3001\u53e4\u3044\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u6b8b\u3063\u305f\u307e\u307e\u81ea\u52d5\u9001\u4fe1\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u65b0\u3057\u3044\u30c8\u30fc\u30af\u30f3\u3092\u5165\u529b\u3057\u3066\u3082\u3001\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u304c\u4e0a\u66f8\u304d\u3057\u3066\u53e4\u3044\u60c5\u5831\u3092\u512a\u5148\u3059\u308b\u2014\u2014\u3053\u308c\u304c\u6700\u521d\u306e\u8a70\u307e\u308a\u3069\u3053\u308d\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p><strong>\u3075\u305f\u3064\u3081\u306f\u3001\u300e\u30c8\u30fc\u30af\u30f3URL\u306e\u7279\u6b8a\u6587\u5b57\u306b\u3088\u308b\u8aa4\u4f5c\u52d5\u300f\u3067\u3059\u3002<\/strong><\/p>\n\n\n\n<p>\u30c8\u30fc\u30af\u30f3\u3092URL\u306b\u76f4\u63a5\u57cb\u3081\u8fbc\u3080\u65b9\u6cd5\u3092\u8a66\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-verse\">```bash<br>git remote set-url origin https:\/\/\u30e6\u30fc\u30b6\u30fc\u540d:\u30c8\u30fc\u30af\u30f3@github.com\/...<br>```<\/pre>\n\n\n\n<p>\u3068\u3053\u308d\u304c\u30c8\u30fc\u30af\u30f3\u306b `@` \u304c\u542b\u307e\u308c\u3066\u3044\u305f\u305f\u3081\u3001\u30b7\u30a7\u30eb\u304c\u9014\u4e2d\u3067\u533a\u5207\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>```<\/p>\n\n\n\n<p>zsh: no such file or directory: om\/\u30e6\u30fc\u30b6\u30fc\u540d\/engineer-diary.git<\/p>\n\n\n\n<pre class=\"wp-block-verse\">```<br>`github.com` \u306e `@` \u4ee5\u964d\u304c\u5225\u306e\u5f15\u6570\u3068\u3057\u3066\u89e3\u91c8\u3055\u308c\u3066\u3057\u307e\u3063\u305f\u3001\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<br>```<\/pre>\n\n\n\n<p><strong>\u307f\u3063\u3064\u3081\u306f\u3001\u300e\u30ea\u30dd\u30b8\u30c8\u30ea\u540d\u5909\u66f4\u5f8c\u306eURL\u66f4\u65b0\u5fd8\u308c\u300f\u3067\u3059\u3002<\/strong><\/p>\n\n\n\n<p>`my-blog` \u2192 `engineer-diary` \u306b\u5909\u3048\u305f\u3068\u304d\u3001\u30ed\u30fc\u30ab\u30eb\u306e\u30ea\u30e2\u30fc\u30c8URL\u304c\u53e4\u3044\u307e\u307e\u3067\u3057\u305f\u3002\u3053\u308c\u304c\u91cd\u306a\u3063\u3066\u3001\u8a8d\u8a3c\u304c\u901a\u3089\u306a\u3044\u539f\u56e0\u306e\u4e00\u3064\u306b\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>GitHub\u306e\u8a8d\u8a3c\u3067\u30cf\u30de\u308a\u304c\u3061\u306a4\u30d1\u30bf\u30fc\u30f3<\/strong><\/h3>\n\n\n\n<p>1. \u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u306b\u53e4\u3044\u8a8d\u8a3c\u60c5\u5831\u304c\u6b8b\u3063\u3066\u3044\u308b\uff08macOS\u7279\u6709\uff09<\/p>\n\n\n\n<p>2. PAT\u306e\u5b58\u5728\u3092\u77e5\u3089\u305a\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3067push\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u308b<\/p>\n\n\n\n<p>3. \u30c8\u30fc\u30af\u30f3URL\u306b\u7279\u6b8a\u6587\u5b57\u304c\u6df7\u3056\u3063\u3066\u3044\u3066\u30b7\u30a7\u30eb\u304c\u8aa4\u4f5c\u52d5\u3059\u308b<\/p>\n\n\n\n<p>4. \u30ea\u30dd\u30b8\u30c8\u30ea\u540d\u5909\u66f4\u5f8c\u306b\u30ea\u30e2\u30fc\u30c8URL\u3092\u66f4\u65b0\u3057\u5fd8\u308c\u308b<\/p>\n\n\n\n<p>\u30dd\u30a4\u30f3\u30c8\u306f\u3001\u300e\u3053\u308c\u3089\u304c\u91cd\u306a\u308b\u3053\u3068\u304c\u3042\u308b\u300f\u3068\u3044\u3046\u70b9\u3067\u3059\u3002<\/p>\n\n\n\n<p>1\u3064\u89e3\u6c7a\u3057\u3066\u3082\u6b21\u306e\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3068\u304d\u306f\u3001\u8907\u6570\u306e\u554f\u984c\u304c\u540c\u6642\u306b\u8d77\u304d\u3066\u3044\u308b\u3068\u7591\u3046\u306e\u304c\u6b63\u89e3\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<!-- \u554f\u3044\u30ab\u30fc\u30c9\uff1aHTML_BLOCK_ASK -->\n<div style=\"border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin:24px 0;background:#fafafa;\">\n  <div style=\"font-weight:700;margin-bottom:6px;\">\u8003\u3048\u76f4\u3059<\/div>\n  <div style=\"padding-left:12px;border-left:3px solid #111;line-height:1.7;\">\n    \u4eca\u306e\u81ea\u5206\u306egit\u8a8d\u8a3c\u3092\u3001\u4e00\u5ea6\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>\n    \u30fb<code>git remote -v<\/code> \u3092\u5b9f\u884c\u3057\u305f\u3068\u304d\u3001URL\u306f <code>https:\/\/<\/code> \u3068 <code>git@<\/code> \u306e\u3069\u3061\u3089\u3067\u59cb\u307e\u3063\u3066\u3044\u307e\u3059\u304b\uff1f\n  <\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u307e\u305a1\u3064\u3060\u3051\u3084\u3063\u3066\u307f\u308b\u3068\u3057\u305f\u3089<\/strong><\/h3>\n\n\n\n<p>\u4eca\u65e5\u3084\u308b\u3053\u3068\u306f1\u3064\u3060\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<!-- \u4eca\u65e5\u3084\u308b\u3053\u3068\u30ab\u30fc\u30c9\uff1aHTML_BLOCK_ONE -->\n<div style=\"border:1px solid #e5e7eb;border-radius:12px;padding:16px;margin:24px 0;background:#fafafa;\">\n  <div style=\"font-weight:700;margin-bottom:6px;\">\u307e\u305a\u306f\uff11\u3064\u3084\u3063\u3066\u307f\u308b<\/div>\n  <div style=\"line-height:1.7;\">\n    \u30fb\u30bf\u30fc\u30df\u30ca\u30eb\u3067 <code>ssh-keygen -t ed25519<\/code> \u3092\u5b9f\u884c\u3057\u3066\u3001SSH\u30ad\u30fc\u30921\u672c\u4f5c\u308b\n  <\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>SSH\u8a2d\u5b9a\u306f\u4e00\u5ea6\u3084\u308c\u3070\u7d42\u308f\u308a\u3067\u3059<\/strong><\/h3>\n\n\n\n<p>\u3082\u3057\u4eca\u3082HTTPS\u3067 `git push` \u3057\u3066\u3044\u308b\u306a\u3089\u3001SSH\u306b\u5207\u308a\u66ff\u3048\u3066\u304a\u3044\u3066\u640d\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u8a8d\u8a3c\u306e\u624b\u9593\u304c\u6e1b\u308b\u3068\u3001\u4f5c\u696d\u306e\u30ea\u30ba\u30e0\u304c\u5c11\u3057\u5909\u308f\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u307e\u3068\u3081\uff1a\u539f\u56e0\u304c1\u3064\u3068\u306f\u9650\u3089\u306a\u3044\u3001\u3068\u3044\u3046\u8a71<\/strong><\/h3>\n\n\n\n<p>\u4eca\u56de\u306e\u5931\u6557\u304b\u3089\u306e\u6559\u8a13\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<p>`git push` \u3067\u3064\u307e\u3063\u305f\u3068\u304d\u3001\u539f\u56e0\u306f1\u3064\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002\u4eca\u56de\u306f3\u3064\u304c\u91cd\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u300e\u8907\u6570\u306e\u554f\u984c\u304c\u91cd\u306a\u3063\u3066\u3044\u308b\u306a\u3089\u3001\u6839\u672c\u304b\u3089\u5909\u3048\u305f\u307b\u3046\u304c\u65e9\u3044\u3053\u3068\u304c\u3042\u308b\u300f\u2014\u2014SSH\u306b\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u3067\u5b66\u3093\u3060\u3053\u3068\u3067\u3059\u3002<\/p>\n\n\n\n<p>GitHub\u3092\u4f7f\u3046\u306a\u3089\u6700\u521d\u304b\u3089SSH\u306b\u3057\u3066\u304a\u304f\u306e\u304c\u3001\u63a8\u6e2c\u3067\u3059\u304c\u6b63\u89e3\u306b\u8fd1\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u540c\u3058\u6cbc\u306b\u306f\u307e\u308b\u4eba\u304c1\u4eba\u3067\u3082\u6e1b\u308c\u3070\u3001\u3053\u306e\u8a18\u9332\u3092\u6b8b\u3057\u305f\u610f\u5473\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH\u8a8d\u8a3c\u306b\u5207\u308a\u66ff\u3048\u308b\u3068\u3001\u5168\u90e8\u89e3\u6c7a\u3057\u305f `git push` \u3067\u3064\u307e\u3063\u305f\u3068\u304d\u3001\u539f\u56e0\u304c1\u3064\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002 \u4eca\u56de\u306f3\u3064\u304c\u91cd\u306a\u3063\u3066\u3044\u307e\u3057\u305f\u3002 - \u300emacOS\u30ad\u30fc\u30c1\u30a7\u30fc\u30f3\u306e\u53e4\u3044\u8a8d\u8a3c\u60c5\u5831\u300f\u304c\u90aa\u9b54\u3092\u3057\u3066\u3044\u305f - \u300e\u30c8\u30fc\u30af\u30f3URL\u306b\u7279\u6b8a\u6587\u5b57\u300f\u304c\u542b\u307e\u308c\u2026<\/p>\n","protected":false},"author":1,"featured_media":1956,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[606],"tags":[529,951,1093,1095,1096,1094],"class_list":["post-1954","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-606","tag-git","tag-github","tag-macos","tag-ssh","tag-1096","tag-1094"],"_links":{"self":[{"href":"https:\/\/syuji-engineer.com\/index.php?rest_route=\/wp\/v2\/posts\/1954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/syuji-engineer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/syuji-engineer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/syuji-engineer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/syuji-engineer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1954"}],"version-history":[{"count":1,"href":"https:\/\/syuji-engineer.com\/index.php?rest_route=\/wp\/v2\/posts\/1954\/revisions"}],"predecessor-version":[{"id":1955,"href":"https:\/\/syuji-engineer.com\/index.php?rest_route=\/wp\/v2\/posts\/1954\/revisions\/1955"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/syuji-engineer.com\/index.php?rest_route=\/wp\/v2\/media\/1956"}],"wp:attachment":[{"href":"https:\/\/syuji-engineer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/syuji-engineer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/syuji-engineer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}