{"id":765,"date":"2023-05-08T20:57:42","date_gmt":"2023-05-08T11:57:42","guid":{"rendered":"https:\/\/shinke1987.net\/?p=765"},"modified":"2023-05-08T20:57:43","modified_gmt":"2023-05-08T11:57:43","slug":"git-tips","status":"publish","type":"post","link":"https:\/\/shinke1987.net\/?p=765","title":{"rendered":"Git Tips"},"content":{"rendered":"\n<h2 id=\"toc0\" class=\"wp-block-heading\">\u30b3\u30de\u30f3\u30c9<\/h2>\n\n\n\n<h6 id=\"toc1\" class=\"wp-block-heading\">GitHub\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u3001\u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30af\u30ed\u30fc\u30f3<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git clone URL \u6307\u5b9a\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d1\u30b9<\/pre><\/p>\n\n\n\n<h6 id=\"toc2\" class=\"wp-block-heading\">\u30ea\u30e2\u30fc\u30c8\u304c\u6b63\u3057\u3044\u3082\u306e\u304b\u3092\u78ba\u8a8d\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git remote -v show<\/pre><\/p>\n\n\n\n<h6 id=\"toc3\" class=\"wp-block-heading\">\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git add *<\/pre><\/p>\n\n\n\n<h6 id=\"toc4\" class=\"wp-block-heading\">\u30b3\u30df\u30c3\u30c8\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git commit -m &quot;\u30b3\u30e1\u30f3\u30c8&quot;<\/pre><\/p>\n\n\n\n<h6 id=\"toc5\" class=\"wp-block-heading\">\u30b3\u30df\u30c3\u30c8\u3055\u308c\u305f\u7d50\u679c\u3092\u78ba\u8a8d\u3059\u308b\uff08\u30ed\u30fc\u30ab\u30eb\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u5bfe\u3057\u3066\uff09<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git log<\/pre><\/p>\n\n\n\n<h6 id=\"toc6\" class=\"wp-block-heading\">\u5909\u66f4\u3092\u30d7\u30c3\u30b7\u30e5\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git push origin master<\/pre><\/p>\n\n\n\n<h6 id=\"toc7\" class=\"wp-block-heading\">\u6700\u521d\u306b\u30d7\u30c3\u30b7\u30e5\u3059\u308b\u6642<\/h6>\n\n\n\n<p>\u3053\u308c\u3092\u3059\u308b\u3053\u3068\u3067\u3001\u4eca\u5f8cpush\u3084pull\u3092\u5b9f\u884c\u3059\u308b\u6642\u306b\u3001\u30ea\u30dd\u30b8\u30c8\u30ea\u3084\u30d6\u30e9\u30f3\u30c1\u306e\u5f15\u6570\u3092\u7701\u7565\u3067\u304d\u308b\u3002<br><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git push -u origin master<\/pre><\/p>\n\n\n\n<h6 id=\"toc8\" class=\"wp-block-heading\">\u5909\u66f4\u3055\u308c\u305f\u7d50\u679c\u3092\u78ba\u8a8d\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">ls-remote<\/pre><\/p>\n\n\n\n<h6 id=\"toc9\" class=\"wp-block-heading\">\u5909\u66f4\u3055\u308c\u305f\u7d50\u679c\u3092\u540c\u671f\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git pull<\/pre><\/p>\n\n\n\n<h6 id=\"toc10\" class=\"wp-block-heading\">GitHub\u3067\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u305f\u5f8c\u3001\u30ed\u30fc\u30ab\u30eb\u304b\u3089\u30ea\u30e2\u30fc\u30c8\u3078\u30b3\u30d4\u30fc\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git remote add origin \u30ea\u30dd\u30b8\u30c8\u30ea\u306eURL &gt; git push -u origin master<\/pre><\/p>\n\n\n\n<h3 id=\"toc11\" class=\"wp-block-heading\">\u72ec\u7fd2Git\u306e\u307e\u3068\u3081<\/h3>\n\n\n\n<h6 id=\"toc12\" class=\"wp-block-heading\">\u30ab\u30ec\u30f3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306bGit\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git init<\/pre><\/p>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git status<\/pre><\/p>\n\n\n\n<h6 id=\"toc13\" class=\"wp-block-heading\">git\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u8de1\u3059\u308b\u3088\u3046\u6307\u5b9a\u3059\u308b<\/h6>\n\n\n\n<p>\u30d5\u30a9\u30eb\u30c0\u3092\u6307\u5b9a\u3059\u308b\u5834\u5408\u306f\u3001.\/\u30d5\u30a9\u30eb\u30c0\u540d\/\u3068\u5165\u529b\u3059\u308b\u3002<br><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git add \u30d5\u30a1\u30a4\u30eb\u540d<\/pre><\/p>\n\n\n\n<h6 id=\"toc14\" class=\"wp-block-heading\">\u30b3\u30df\u30c3\u30c8\u3059\u308b\u524d\u306e\u5dee\u5206\u3092\u8868\u793a\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git diff<\/pre><\/p>\n\n\n\n<h6 id=\"toc15\" class=\"wp-block-heading\">\u65e2\u306b\u8ffd\u8de1\u3055\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u3092\u30b3\u30df\u30c3\u30c8\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git commit -a -m &quot;\u30b3\u30e1\u30f3\u30c8&quot;<\/pre><\/p>\n\n\n\n<h6 id=\"toc16\" class=\"wp-block-heading\">\u30b3\u30df\u30c3\u30c8\u3055\u308c\u305f\u3082\u306e\u306e\u89aa\u3092\u78ba\u8a8d\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git log --parents<\/pre><\/p>\n\n\n\n<h6 id=\"toc17\" class=\"wp-block-heading\">1\u884c\u3067ID\u3068\u30b3\u30e1\u30f3\u30c8\u304c\u8868\u793a\u3055\u308c\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git log --oneline<\/pre><\/p>\n\n\n\n<h6 id=\"toc18\" class=\"wp-block-heading\">HEAD\u3092\u904e\u53bb\u306b\u30b3\u30df\u30c3\u30c8\u3055\u308c\u305f\u3082\u306e\u306b\u6307\u5b9a\u3059\u308b<\/h6>\n\n\n\n<p>\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u30a8\u30ea\u30a2\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u3082\u305d\u306e\u904e\u53bb\u306b\u30b3\u30df\u30c3\u30c8\u3055\u308c\u305f\u6642\u70b9\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u306a\u308b\u3002<br><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git checkout ID\uff086\u6841\u3067\u826f\u3044\uff09<\/pre><\/p>\n\n\n\n<h6 id=\"toc19\" class=\"wp-block-heading\">\u30de\u30b9\u30bf\u30fc\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u3057\u3066\u8a2d\u5b9a\u3059\u308b<\/h6>\n\n\n\n<p>\u30de\u30b9\u30bf\u30fc\u30d6\u30e9\u30f3\u30c1\u306e\u6700\u65b0\u306e\u3082\u306e\u306b\u3057\u305f\u3044\u6642\u306b\u4f7f\u3046\u3002<br><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git checkout master<\/pre><\/p>\n\n\n\n<h6 id=\"toc20\" class=\"wp-block-heading\">\u65e2\u6210\u306e\u30d6\u30e9\u30f3\u30c1\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3059\u308b<\/h6>\n\n\n\n<p>\u9078\u629e\u3057\u3066\u3044\u308b\u30d6\u30e9\u30f3\u30c1\u540d\u306e\u5de6\u306b*\u304c\u4ed8\u304f\u3002<br><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git branch<\/pre><\/p>\n\n\n\n<h6 id=\"toc21\" class=\"wp-block-heading\">\u6307\u5b9a\u3057\u305f\u540d\u524d\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u4f5c\u6210\u3059\u308b<\/h6>\n\n\n\n<p>\uff08\u73fe\u5728\u9078\u629e\u3057\u3066\u3044\u308b\u30b3\u30df\u30c3\u30c8\u304b\u3089\u679d\u5206\u304b\u308c\u3092\u3059\u308b\uff09<br><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git branch \u30d6\u30e9\u30f3\u30c1\u540d<\/pre><\/p>\n\n\n\n<h6 id=\"toc22\" class=\"wp-block-heading\">\u5bfe\u8c61\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u306e\u6700\u65b0\u306e\u3082\u306e\u3092\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git checkout \u30d6\u30e9\u30f3\u30c1\u540d<\/pre><\/p>\n\n\n\n<h6 id=\"toc23\" class=\"wp-block-heading\">\u5bfe\u8c61\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664\u3059\u308b<\/h6>\n\n\n\n<p><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git branch -d \u30d6\u30e9\u30f3\u30c1\u540d<\/pre><\/p>\n\n\n\n<h2 id=\"toc24\" class=\"wp-block-heading\">Tips<\/h2>\n\n\n\n<h6 id=\"toc25\" class=\"wp-block-heading\">\u65e5\u672c\u8a9e\u30d5\u30a1\u30a4\u30eb\u306e\u6587\u5b57\u5316\u3051\u5bfe\u7b56<\/h6>\n\n\n\n<p>\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308c\u3070\u826f\u3044\u3002<br><pre class=\"brush: bash; title: ; notranslate\" title=\"\">git config --global core.quotepath false<\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30b3\u30de\u30f3\u30c9 GitHub\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u3001\u6307\u5b9a\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30af\u30ed\u30fc\u30f3 git clone URL \u6307\u5b9a\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d1\u30b9 \u30ea\u30e2\u30fc\u30c8\u304c\u6b63\u3057\u3044\u3082\u306e\u304b\u3092\u78ba\u8a8d\u3059\u308b git remote -v show \u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30d5\u30a1\u30a4\u30eb\u3092 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[84],"tags":[85],"class_list":["post-765","post","type-post","status-publish","format-standard","hentry","category-git","tag-git"],"_links":{"self":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=765"}],"version-history":[{"count":24,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/765\/revisions"}],"predecessor-version":[{"id":789,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/765\/revisions\/789"}],"wp:attachment":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=765"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}