{"id":73,"date":"2023-02-12T00:00:00","date_gmt":"2023-02-11T15:00:00","guid":{"rendered":"https:\/\/hmhr.ath.cx\/?p=73"},"modified":"2023-04-17T17:38:31","modified_gmt":"2023-04-17T08:38:31","slug":"git%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/hmhr.ath.cx\/?p=73","title":{"rendered":"git\u3092\u4f7f\u3063\u3066\u307f\u308b"},"content":{"rendered":"\n<p>git hub\u304c\u6d41\u884c\u3063\u305f\u3053\u3068\u3082\u3042\u308a\u3001\u6700\u8fd1\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u306fgit\u304c\u307b\u3068\u3093\u3069\u3060\u3068\u3082\u3046\u3002<br>\u4eca\u56de\u306f\u5c11\u3057git\u3092\u89e6\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3046\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">git\u7ba1\u7406\u3092\u59cb\u3081\u3066\u898b\u308b<\/h2>\n\n\n\n<p>git\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u7f6e\u304f\u304b\u3089\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001\u305d\u3053\u3067\u3001git\u306e\u521d\u671f\u5316\u3092\u884c\u3046\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nmkdir \/tmp\/project.git\ncd \/tmp\/project.git\ngit --bare init\n<\/pre><\/div>\n\n\n<p>\u3053\u308c\u3067\u3001\u30ea\u30dd\u30b8\u30c8\u30ea\u304c\u4f5c\u6210\u3055\u308c\u308b\u3002<br>\u3061\u306a\u307f\u306b\u3001\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u76f4\u63a5\u3053\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u3067\u4f5c\u696d\u3059\u308b\u3053\u3068\u306f\u306a\u3044\u3002<br>\u30a4\u30e1\u30fc\u30b8\u7684\u306b\u306f\u30b5\u30fc\u30d0\u5074\u306e\u521d\u671f\u5316\u304c\u7d42\u308f\u3063\u305f\u6bb5\u968e\u3068\u3044\u3046\u611f\u3058\u3060\u3002<\/p>\n\n\n\n<p>\u6b21\u306b\u3001\u5148\u7a0b\u4f5c\u3063\u305f\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u30af\u30ed\u30fc\u30f3\u3057\u3066\u4f5c\u696d\u5834\u6240\u3092\u4f5c\u6210\u3057\u3001\u30d5\u30a1\u30a4\u30eb\u8ffd\u52a0\u3092\u884c\u3063\u3066\u307f\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ncd ~\ngit clone \/tmp\/proect.git\ncd project\ntouch new.txt\ngit add new.txt\ngit commit\n<\/pre><\/div>\n\n\n<p>\u3053\u3053\u307e\u3067\u3067\u3001new.txt\u304cgit\u306e\u7ba1\u7406\u4e0b\u306b\u7f6e\u304b\u308c\u30b3\u30df\u30c3\u30c8\u3055\u308c\u305f\u306e\u3067\u3001\u6b21\u306f\u30d7\u30c3\u30b7\u30e5\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ngit push origin master\n<\/pre><\/div>\n\n\n<p>\u3053\u308c\u3067\u3001\u30ea\u30e2\u30fc\u30c8\u306b\u30d7\u30c3\u30b7\u30e5\u3055\u308c\u4ed6\u306e\u4eba\u3082new.txt\u3092\u7de8\u96c6\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30ed\u30b0\u3092\u898b\u3084\u3059\u304f\u3057\u3066\u307f\u308b<\/h2>\n\n\n\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30ed\u30b0\u3092\u898b\u308b\u306b\u306f<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit log\n<\/pre><\/div>\n\n\n<p>\u3068\u3059\u308b\u3053\u3068\u3067\u3001\u30ed\u30b0\u3092\u898b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<br>\u3057\u304b\u3057\u3001\u3053\u308c\u3060\u3068\u30d6\u30e9\u30f3\u30c1\u306e\u6d41\u308c\u304c\u628a\u63e1\u3057\u306b\u304f\u3044\u306e\u3067\u3061\u3087\u3063\u3068\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u307f\u308b\u3002<br>\u3084\u308b\u3053\u3068\u306f\u3001\u8272\u3092\u4ed8\u3051\u308b\u306e\u3068\u3001\u30b0\u30e9\u30d5\u8868\u793a\u306b\u3059\u308b\u306e\uff12\u70b9\u3002<\/p>\n\n\n\n<p>\u307e\u305a\u306f\u8272\u3092\u3064\u3051\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ngit config --global color.ui auto\ngit config --global core.pager &quot;lv -c&quot;\n<\/pre><\/div>\n\n\n<p>&#8211;global \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u3053\u3067\u3057\u305f\u8a2d\u5b9a\u306f\u30e6\u30fc\u30b6\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u8fbc\u307e\u308c\u3001\u5b9f\u884c\u3057\u305f\u30e6\u30fc\u30b6\u306b\u306e\u307f\u8a2d\u5b9a\u304c\u53cd\u6620\u3055\u308c\u308b\u3002<br>\u3082\u3057\u3001\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u3067\u540c\u3058\u8a2d\u5b9a\u3092\u884c\u3044\u305f\u3044\u5834\u5408\u306f &#8211;system \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3002<br>\u307e\u305f\u3001\u7279\u5b9a\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u306e\u307f\u53cd\u6620\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u7121\u3057\u304b\u3001&#8211;local \u3092\u6307\u5b9a\u3059\u308c\u3070\u3044\u3044\u3002<\/p>\n\n\n\n<p>\u6b21\u306b\u3001\u30ed\u30b0\u306e\u51fa\u529b\u5f62\u5f0f\u3092\u8a2d\u5b9a\u3059\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ngit config --global alias.lg 'log --graph --all --pretty=format:&quot;%h %Cred%d%Creset %s&quot;'\n<\/pre><\/div>\n\n\n<p>\u3053\u308c\u3067git lg \u3068\u5b9f\u884c\u3059\u308b\u3068\u30b0\u30e9\u30d5\u8868\u793a\u3067\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br>alias.lg \u3067 lg \u306b\u5bfe\u3057\u3066log\u30b3\u30de\u30f3\u30c9\u3068\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u30a8\u30a4\u30ea\u30a2\u30b9\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<br>\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u3064\u3044\u3066\u306f\u3001git-log\u306eman\u306eThe placeholders are:\u3068\u3044\u3046\u898b\u51fa\u3057\u306e\u90e8\u5206\u306b\u8a73\u7d30\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<p>\u4eca\u307e\u3067\u5b9f\u884c\u3057\u3066\u304d\u305f\u30b3\u30de\u30f3\u30c9\u306e\u8a2d\u5b9a\u60c5\u5831\u306f\u3001\u30db\u30fc\u30e0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e.gitconfig\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u3002<br>\u30b3\u30de\u30f3\u30c9\u3092\u3044\u3061\u3044\u3061\u5b9f\u884c\u305b\u305a\u306b\u76f4\u63a5\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3057\u3066\u3082OK\u3002<br>\u4eca\u307e\u3067\u306e\u30b3\u30de\u30f3\u30c9\u7d50\u679c\u306e.gitconfig\u306f<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;color]\n    ui = auto\n&#x5B;core]\n    pager = lv -c\n&#x5B;alias]\n    lg = log --graph --all --pretty=format:\\&quot;%h %Cred%d%Creset %s\\&quot;\n<\/pre><\/div>\n\n\n<p>\u3068\u306a\u3063\u3066\u3044\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>git hub\u304c\u6d41\u884c\u3063\u305f\u3053\u3068\u3082\u3042\u308a\u3001\u6700\u8fd1\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u306fgit\u304c\u307b\u3068\u3093\u3069\u3060\u3068\u3082\u3046\u3002\u4eca\u56de\u306f\u5c11\u3057git\u3092\u89e6\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3046\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,4],"tags":[12],"class_list":["post-73","post","type-post","status-publish","format-standard","hentry","category-development","category-linux","tag-git"],"_links":{"self":[{"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=73"}],"version-history":[{"count":3,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/posts\/73\/revisions"}],"predecessor-version":[{"id":124,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=\/wp\/v2\/posts\/73\/revisions\/124"}],"wp:attachment":[{"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hmhr.ath.cx\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}