{"id":99,"date":"2025-05-03T22:29:03","date_gmt":"2025-05-03T13:29:03","guid":{"rendered":"https:\/\/www.kuruma-ai-life.top\/?p=99"},"modified":"2025-05-03T22:29:04","modified_gmt":"2025-05-03T13:29:04","slug":"%f0%9f%9a%80-git-github-%e3%83%af%e3%83%bc%e3%82%af%e3%83%95%e3%83%ad%e3%83%bc%ef%bc%88mac-%e2%87%94-linux-%e9%96%8b%e7%99%ba%e7%92%b0%e5%a2%83%e5%85%b1%e6%9c%89%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.kuruma-ai-life.top\/?p=99","title":{"rendered":"\ud83d\ude80 Git &amp; GitHub \u30ef\u30fc\u30af\u30d5\u30ed\u30fc\uff08Mac \u21d4 Linux \u958b\u767a\u74b0\u5883\u5171\u6709\uff09"},"content":{"rendered":"\n<p>\u4eca\u65e5\u306f\u958b\u767a\u306e\u9032\u6357\u304b\u3089\u4e00\u6b69\u8a71\u3092\u9038\u3089\u3057\u3066\uff0cMac\u3068Linux\u9593\u3067\u306eAI\u958b\u767a\u3084\u753b\u50cf\u51e6\u7406\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u5feb\u9069\u306b\u540c\u671f\u3059\u308b\u305f\u3081\u306e\u3001<strong>Git &amp; GitHub \u30ef\u30fc\u30af\u30d5\u30ed\u30fc<\/strong>\u3092\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd11 1. SSH\u9375\u306e\u4f5c\u6210\u3068GitHub\u8a2d\u5b9a<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\" data-start=\"0\"><code># SSH\u9375\u3092\u4f5c\u6210\uff08\u3059\u3067\u306b\u3042\u308b\u5834\u5408\u306f\u30b9\u30ad\u30c3\u30d7\u53ef\uff09\nssh-keygen -t rsa -b 4096 -C &quot;your-email@example.com&quot;\n\n# \u516c\u958b\u9375\u306e\u8868\u793a\uff08\u30b3\u30d4\u30fc\u3057\u3066GitHub\u306b\u8cbc\u308a\u4ed8\u3051\uff09\ncat ~\/.ssh\/id_rsa.pub<\/code><\/pre><\/div>\n\n\n\n<p>GitHub \u2192 Settings \u2192\u00a0<strong>SSH and GPG keys<\/strong>\u00a0\u2192 \u300cNew SSH key\u300d\u3067\u8cbc\u308a\u4ed8\u3051<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83e\uddf0 2. Git \u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u306e\u8a2d\u5b9a\uff08\u521d\u56de\u306e\u307f\uff09<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>git config --global user.name &quot;Your Name&quot;\ngit config --global user.email &quot;your-email@example.com&quot;<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udcc1 3. \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u521d\u671f\u5316\u3068&nbsp;<code>.gitignore<\/code>&nbsp;\u4f5c\u6210<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>cd kuruma-ai  # \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3078\u79fb\u52d5\ngit init      # Git\u521d\u671f\u5316<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p><code>.gitignore<\/code>\u00a0\u306e\u4f8b<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code># \u4eee\u60f3\u74b0\u5883\u30fb\u30ad\u30e3\u30c3\u30b7\u30e5\u30fb\u5927\u5bb9\u91cf\u30d5\u30a1\u30a4\u30eb\u9664\u5916\nvenv\/\n__pycache__\/\n*.mp4\n*.pth\ndata\/\n<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd17 4. GitHub \u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u63a5\u7d9a<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>git remote add origin git@github.com:your-username\/kuruma-ai.git<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udce4 5. \u30d5\u30a1\u30a4\u30eb\u3092\u767b\u9332\u3057\u3066 push<\/h2>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>git add .\ngit commit -m &quot;Initial commit&quot;\ngit push -u origin main<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddfc \u30a8\u30e9\u30fc\u5bfe\u7b56\uff1a\u5bb9\u91cf\u8d85\u904e\u6642\uff08pack exceeds 2.0GB\uff09<\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code># .gitignore \u306b\u9664\u5916\u5bfe\u8c61\u3092\u8ffd\u52a0\u3057\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u304b\u3089\u3082\u524a\u9664\ngit rm -r --cached data\/\ngit rm --cached model.pth\n\n# \u518d\u5ea6 add \u2192 commit \u2192 push\ngit add .\ngit commit -m &quot;Removed large files&quot;\ngit push -u origin main<\/code><\/pre><\/div>\n\n\n\n<pre class=\"wp-block-preformatted\"><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd04 6. Mac \u21d4 Linux \u540c\u671f<\/h2>\n\n\n\n<p>\u2705 Mac \u304b\u3089 Linux \u306b\u8ee2\u9001\uff08\u4f8b\uff09<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>scp -r .\/kuruma-ai shu@192.168.0.100:\/home\/shu\/<\/code><\/pre><\/div>\n\n\n\n<pre class=\"wp-block-preformatted\"><br><\/pre>\n\n\n\n<p>\u2705 Linux \u5074\u3067 clone<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>git clone git@github.com:your-username\/kuruma-ai.git<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>\ud83d\udda5\ufe0f Git \u78ba\u8a8d\u30b3\u30de\u30f3\u30c9<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>git status                # \u5909\u66f4\u78ba\u8a8d\ngit log --oneline -n 3    # \u6700\u65b03\u4ef6\u306e\u30ed\u30b0<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>\ud83d\udd10 SSH\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u8a2d\u5b9a\uff08~\/.ssh\/config\uff09<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>Host linux-ai\n    HostName 192.168.0.100\n    User shu\n    IdentityFile ~\/.ssh\/id_rsa<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30dd\u30a4\u30f3\u30c8<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>.gitignore<\/code>\u00a0\u306e\u6574\u5099\u304c\u6700\u91cd\u8981\uff1a\u4eee\u60f3\u74b0\u5883\u3084\u30c7\u30fc\u30bf\u985e\u306f\u5171\u6709\u3057\u306a\u3044<\/li>\n\n\n\n<li><code>.ssh\/config<\/code>\u00a0\u3092\u4f7f\u3063\u3066\u00a0<code>ssh linux-ai<\/code>\u00a0\u3067\u63a5\u7d9a\u3092\u7c21\u7565\u5316<\/li>\n\n\n\n<li>Docker\u3067\u52d5\u304b\u3059\u5834\u5408\u3082\u3053\u306e\u69cb\u6210\u3067\u5341\u5206\u9023\u643a\u53ef\u80fd<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u65e5\u306f\u958b\u767a\u306e\u9032\u6357\u304b\u3089\u4e00\u6b69\u8a71\u3092\u9038\u3089\u3057\u3066\uff0cMac\u3068Linux\u9593\u3067\u306eAI\u958b\u767a\u3084\u753b\u50cf\u51e6\u7406\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u5feb\u9069\u306b\u540c\u671f\u3059\u308b\u305f\u3081\u306e\u3001Git amp; GitHub \u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u3092\u307e\u3068\u3081\u307e\u3057\u305f\u3002 \ud83d\udd11 1. SSH\u9375\u306e\u4f5c\u6210\u3068GitHub\u8a2d<\/p>\n","protected":false},"author":1,"featured_media":104,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[114],"tags":[],"class_list":["post-99","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-114"],"jetpack_featured_media_url":"https:\/\/www.kuruma-ai-life.top\/wp-content\/uploads\/2025\/05\/d9c4825a-932b-4483-a862-99a0b1f4e4b1.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.kuruma-ai-life.top\/index.php?rest_route=\/wp\/v2\/posts\/99","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kuruma-ai-life.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kuruma-ai-life.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kuruma-ai-life.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kuruma-ai-life.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=99"}],"version-history":[{"count":4,"href":"https:\/\/www.kuruma-ai-life.top\/index.php?rest_route=\/wp\/v2\/posts\/99\/revisions"}],"predecessor-version":[{"id":103,"href":"https:\/\/www.kuruma-ai-life.top\/index.php?rest_route=\/wp\/v2\/posts\/99\/revisions\/103"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kuruma-ai-life.top\/index.php?rest_route=\/wp\/v2\/media\/104"}],"wp:attachment":[{"href":"https:\/\/www.kuruma-ai-life.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=99"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kuruma-ai-life.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=99"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kuruma-ai-life.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=99"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}