{"id":272,"date":"2023-10-23T00:33:55","date_gmt":"2023-10-22T15:33:55","guid":{"rendered":"https:\/\/shugomatsuzawa.com\/techblog\/?p=272"},"modified":"2023-10-23T00:33:57","modified_gmt":"2023-10-22T15:33:57","slug":"github%e3%81%98%e3%82%83%e3%81%aa%e3%81%84git%e3%82%92%e8%87%aa%e5%88%86%e3%81%ae%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%ab%e4%bd%9c%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/shugomatsuzawa.com\/techblog\/2023\/10\/23\/272\/","title":{"rendered":"GitHub\u3058\u3083\u306a\u3044Git\u3092\u81ea\u5206\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u4f5c\u308b\u65b9\u6cd5"},"content":{"rendered":"\n<p>\u81ea\u5206\u306e\u30b5\u30fc\u30d0\u30fc\u3078\u306eGit\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u4f5c\u308a\u65b9\u306b\u3064\u3044\u3066\u77e5\u308a\u305f\u3044\u306e\u306b\u3001\u30b0\u30b0\u308b\u3068GitHub\u306e\u3084\u308a\u65b9\u3070\u304b\u308a\u51fa\u3066\u304f\u308b\u3002<br>\u56f0\u3063\u305f\u3082\u306e\u3060\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30b5\u30fc\u30d0\u30fc\u5074\u306e\u4f5c\u696d<\/h2>\n\n\n\n<p>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u3063\u3066\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/data\/git\nsudo mkdir sample.git\nsudo chmod -R o+w sample.git<\/code><\/pre>\n\n\n\n<p><code>git init<\/code>\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd sample.git\ngit init --bare --shared=true<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u4f5c\u696d<\/h2>\n\n\n\n<p>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u3063\u3066\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u307e\u3067\u3002<br><a href=\"https:\/\/shugomatsuzawa.com\/techblog\/2022\/05\/15\/54\/\" data-type=\"post\" data-id=\"54\">SSH Config\u306e\u8a2d\u5b9a\u306f\u3053\u3061\u3089\u3002<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir sample\ncd sample\ngit init\ngit branch -m main # \u30d6\u30e9\u30f3\u30c1\u540d\u5909\u66f4\ngit remote add origin ssh:\/\/ssh config\u306e\u8a2d\u5b9a\u540d\/var\/data\/git\/sample.git<\/code><\/pre>\n\n\n\n<p>\u8a66\u3057\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u3063\u3066\u30b3\u30df\u30c3\u30c8\u3057\u3066\u307f\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo \"git test\" > readme\ngit add .\ngit commit -m \"Initial commit\"\ngit push -u origin main # \u30d6\u30e9\u30f3\u30c1\u4f5c\u6210\u3059\u308b\u3068\u304d\u306f-u\u3092\u3064\u3051\u308b<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5f79\u7acb\u3064\u30b3\u30de\u30f3\u30c9<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u30ea\u30e2\u30fc\u30c8\u3092\u542b\u3080\u5168\u3066\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u8868\u793a\ngit branch -a\n#\u30d6\u30e9\u30f3\u30c1\u306e\u8ffd\u8de1\u95a2\u4fc2\u3092\u898b\u305f\u3044\u6642\ngit branch -vv<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u53c2\u8003<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/qiita.com\/onigra\/items\/326ba157d5552f0076be\" target=\"_blank\" rel=\"noreferrer noopener\">Git\u30ea\u30e2\u30fc\u30c8\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u4f5c\u308a\u65b9 #Git &#8211; Qiita<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/renkin3q.hatenablog.jp\/entry\/2017\/07\/13\/094413\" data-type=\"URL\" data-id=\"https:\/\/renkin3q.hatenablog.jp\/entry\/2017\/07\/13\/094413\" target=\"_blank\" rel=\"noreferrer noopener\">git push \u304c\u30a8\u30e9\u30fc\u3067\u5931\u6557\u3059\u308b &#8211; \u4eee\u904b\u7528\u4e2d<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.sejuku.net\/blog\/71612\" target=\"_blank\" rel=\"noreferrer noopener\">1\u5206\u3067\u308f\u304b\u308b!git\u3067\u306e\u30d6\u30e9\u30f3\u30c1\u306e\u4f5c\u308a\u65b9\u3068\u30ea\u30e2\u30fc\u30c8\u306b\u4e0a\u3052\u308b\u307e\u3067! | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"\u81ea\u5206\u306e\u30b5\u30fc\u30d0\u30fc\u3078\u306eGit\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u4f5c\u308a\u65b9\u306b\u3064\u3044\u3066\u77e5\u308a\u305f\u3044\u306e\u306b\u3001\u30b0\u30b0\u308b\u3068GitHub\u306e\u3084\u308a\u65b9\u3070\u304b\u308a\u51fa\u3066\u304f\u308b\u3002\u56f0\u3063\u305f\u3082\u306e\u3060\u3002 \u30b5\u30fc\u30d0\u30fc\u5074\u306e\u4f5c\u696d \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u3063\u3066\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3059\u308b\u3002 git init\u3059\u308b\u3002 \u30af\u30e9\u30a4 [&hellip;]","protected":false},"author":1,"featured_media":276,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[8],"tags":[80,9,76,10],"class_list":["post-272","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-system-management","tag-git","tag-linux","tag-unix","tag-memo"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/shugomatsuzawa.com\/techblog\/wp-content\/uploads\/sites\/3\/2023\/10\/code-7522129_1280.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/272","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/comments?post=272"}],"version-history":[{"count":2,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/272\/revisions"}],"predecessor-version":[{"id":277,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/posts\/272\/revisions\/277"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media\/276"}],"wp:attachment":[{"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/media?parent=272"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/categories?post=272"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shugomatsuzawa.com\/techblog\/wp-json\/wp\/v2\/tags?post=272"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}