{"id":1245,"date":"2012-08-15T10:57:36","date_gmt":"2012-08-15T01:57:36","guid":{"rendered":"http:\/\/redwing.moo.jp\/cocoa\/?p=1245"},"modified":"2013-04-12T19:59:18","modified_gmt":"2013-04-12T10:59:18","slug":"git-%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/redwing.moo.jp\/cocoa\/archives\/1245","title":{"rendered":"Git \u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>git \u306b\u3064\u3044\u3066\u3088\u304f\u5206\u304b\u3063\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u8abf\u3079\u3066\u307f\u305f\u3002<br \/>\n\u3088\u304f\u5206\u304b\u3089\u306a\u304b\u3063\u305f\u539f\u56e0\u306f\u3001git \u7279\u6709\u306e\u6982\u5ff5\u3001\u7528\u8a9e\u306a\u3069\u306b\u3042\u3063\u305f\u3068\u611f\u3058\u3066\u3044\u305f\u306e\u3067\u3001\u4ee5\u4e0b\u306b\u307e\u3068\u3081\u305f\u3002<\/p>\n<p>\u6982\u5ff5\u306b\u3064\u3044\u3066\u306f\u4ee5\u4e0b\u306e\u8cc7\u6599\u3092\u53c2\u7167\u3059\u308b\u306e\u304c\u3044\u3044\u3002<\/p>\n<p><a href=\"http:\/\/rogerdudler.github.com\/git-guide\/index.ja.html\" title=\"git - \u7c21\u5358\u30ac\u30a4\u30c9 \u732b\u3067\u3082\u308f\u304b\u308bGit \u6700\u521d\u306e\u4e00\u6b69\" target=\"_blank\">git &#8211; \u7c21\u5358\u30ac\u30a4\u30c9 \u732b\u3067\u3082\u308f\u304b\u308bGit \u6700\u521d\u306e\u4e00\u6b69<\/a><br \/>\n<a href=\"http:\/\/git-scm.com\/book\/ja\" title=\"Git - Book\" target=\"_blank\">Git &#8211; Book<\/a><\/p>\n<p>\u7528\u8a9e\u306b\u3064\u3044\u3066\u3082\u3001\u4ee5\u4e0b\u306b\u307e\u3068\u3081\u305f\u3002<br \/>\norigin, master, head \u3068\u304b\u3088\u304f\u610f\u5473\u304c\u308f\u304b\u3093\u306a\u304b\u3063\u305f\u3051\u3069\u3001\u5c11\u3057\u3059\u3063\u304d\u308a\u3057\u305f\u3002<\/p>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u30af\u30ed\u30fc\u30f3\u3057\u3066\u3001\u30b3\u30df\u30c3\u30c8\u3059\u308b\u307e\u3067\u306e\u30b3\u30de\u30f3\u30c9\u306b\u3064\u3044\u3066\u3082\u307e\u3068\u3081\u305f\u306e\u3067\u3001<br \/>\n\u3042\u3068\u306f\u5b9f\u969b\u306e\u7d4c\u9a13\u304b\u3089\u306e\u5f97\u3089\u308c\u308b\u77e5\u8b58\u3092\u84c4\u7a4d\u3057\u3066\u3044\u3051\u3070 OK \u3067\u3057\u3087\u3046\u3002<br \/>\n\u6539\u3081\u3066\u3001\u30d6\u30e9\u30f3\u30c1\u3063\u3066\u4fbf\u5229\u3060\u306a\u3068\u611f\u3058\u305f\u306e\u3067\u3001\u7a4d\u6975\u7684\u306b\u4f7f\u3063\u3066\u3044\u304d\u305f\u3044\u3002^_^<\/p>\n<h4>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<p>macport \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5834\u5408<\/p>\n<pre>\r\n$ sudo port install git-core +gitweb +svn\r\n<\/pre>\n<h4>\u8a2d\u5b9a\u306b\u3064\u3044\u3066<\/h4>\n<p><strong>~\/.gitconfig<\/strong><br \/>\n\u7279\u5b9a\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u5bfe\u3059\u308b\u8a2d\u5b9a\u5024\u3092\u4fdd\u6301\u3059\u308b\u3002<br \/>\n&#8211;global \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u660e\u78ba\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u8aad\u307f\u66f8\u304d\u3092\u884c\u3046\u3002<\/p>\n<p><strong>\/etc\/gitconfig<\/strong><br \/>\n\u30b7\u30b9\u30c6\u30e0\u4e0a\u306e\u5168\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u3068\u5168\u3066\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u5bfe\u3059\u308b\u8a2d\u5b9a\u5024\u3092\u4fdd\u6301\u3059\u308b\u3002<br \/>\n&#8211;system \u30aa\u30d7\u30b7\u30e7\u30f3\u3092 git config \u306b\u6307\u5b9a\u3059\u308b\u3068\u3001\u660e\u78ba\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u8aad\u307f\u66f8\u304d\u3092\u884c\u3046\u3002<\/p>\n<p>\u73fe\u5728\u4f7f\u3063\u3066\u3044\u308b\u3001\u3042\u3089\u3086\u308b\u30ea\u30dd\u30b8\u30c8\u30ea\u306e Git\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb ( .git\/config )<br \/>\n\u7279\u5b9a\u306e\u5358\u4e00\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u5bfe\u3059\u308b\u8a2d\u5b9a\u5024\u3092\u4fdd\u6301\u3059\u308b\u3002<br \/>\n\u305d\u308c\u305e\u308c\u306e\u30ec\u30d9\u30eb\u5024\u306f\u4ee5\u524d\u306e\u30ec\u30d9\u30eb\u5024\u3092\u4e0a\u66f8\u304d\u3059\u308b\u305f\u3081\u3001.git\/config \u4e2d\u306e\u8a2d\u5b9a\u5024\u306f \/etc\/gitconfig \u306e\u8a2d\u5b9a\u5024\u306b\u512a\u5148\u3055\u308c\u308b\u3002<\/p>\n<p><strong>.gitignore<\/strong><br \/>\n\u7121\u8996\u3055\u305b\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u4fdd\u6301\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3002<br \/>\n.gitignore \u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u8ff0\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u898f\u5247\u306f\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<p>\u7a7a\u884c\u3042\u308b\u3044\u306f # \u3067\u59cb\u307e\u308b\u884c\u306f\u7121\u8996\u3055\u308c\u308b<br \/>\n\u6a19\u6e96\u306e glob \u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u7528\u53ef\u80fd<br \/>\n\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u6307\u5b9a\u3059\u308b\u306b\u306f\u3001\u30d1\u30bf\u30fc\u30f3\u306e\u6700\u5f8c\u306b\u30b9\u30e9\u30c3\u30b7\u30e5 (\/) \u3092\u3064\u3051\u308b<br \/>\n\u30d1\u30bf\u30fc\u30f3\u3092\u9006\u8ee2\u3055\u305b\u308b\u306b\u306f\u3001\u6700\u521d\u306b\u611f\u5606\u7b26 (!) \u3092\u3064\u3051\u308b<\/p>\n<pre lang=\"bash\" line=\"1\">\r\n# \u30b3\u30e1\u30f3\u30c8\u884c\r\n*.a       \t# .a \u30d5\u30a1\u30a4\u30eb\u306f\u7ba1\u7406\u5bfe\u8c61\u5916\u3068\u3059\u308b\r\n!lib.a    \t# \u3057\u304b\u3057\u3001lib.a \u30d5\u30a1\u30a4\u30eb\u3060\u3051\u306f .a \u3067\u3042\u3063\u3066\u3082\u8ffd\u8de1\u5bfe\u8c61\u3068\u3059\u308b\r\n\/TODO           # \u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e TODO \u30d5\u30a1\u30a4\u30eb\u3060\u3051\u3092\u5bfe\u8c61\u5916\u3068\u3057\u3001\u30b5\u30d6\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e TODO \u306f\u5bfe\u8c61\u5916\u3068\u3057\u306a\u3044\r\nbuild\/    \t# build\/ \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5bfe\u8c61\u5916\u3068\u3059\u308b\r\ndoc\/*.txt \t# doc\/notes.txt \u306f\u7121\u8996\u3057\u307e\u3059\u304c\u3001doc\/server\/arch.txt \u306f\u7121\u8996\u3057\u307e\u305b\u3093\r\n<\/pre>\n<p><strong>xcode \u7528\u306e gitignore<\/strong><\/p>\n<pre lang=\"bash\" line=\"1\">\r\n.DS_Store\r\n*.swp\r\n*~.nib\r\nbuild\/\r\n\r\n*.pbxuser\r\n*.perspective\r\n*.perspectivev3\r\n\r\n#!xcuserdata\/\r\n#*.xcuserstate\r\nUserInterfaceState.xcuserstate\r\n<\/pre>\n<h4>\u7528\u8a9e\u306b\u3064\u3044\u3066<\/h4>\n<p><strong>\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30af\u30ed\u30fc\u30f3\u3059\u308b<\/strong><br \/>\nGit \u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30b3\u30d4\u30fc\u3059\u308b\u3053\u3068\u3002<br \/>\nSubversion \u306a\u3069\u306e checkout \u3068\u610f\u5473\u304c\u9055\u3046\u3053\u3068\u306b\u6ce8\u610f\u3002<br \/>\nGit \u306f\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u4fdd\u6301\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u3092\u307b\u307c\u3059\u3079\u3066\u30b3\u30d4\u30fc\u3059\u308b\u3002<br \/>\n\u305d\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5168\u5c65\u6b74\u304c\u3001git clone \u3067\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u30af\u30ed\u30fc\u30f3\u3059\u308b\u306b\u306f git clone [url] \u3068\u3059\u308b\u3002<br \/>\n\u4f8b\u3048\u3070\u3001Ruby \u306e Git \u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3042\u308b Grit \u3092\u30af\u30ed\u30fc\u30f3\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b3\u30de\u30f3\u30c9\u5165\u529b\u3059\u308b\u3002<\/p>\n<pre>\r\n$ git clone git:\/\/github.com\/schacon\/grit.git\r\n<\/pre>\n<p><strong>\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u30fb\u30a8\u30ea\u30a2<\/strong><br \/>\nGit\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u542b\u307e\u308c\u308b\u3001\u6b21\u306e\u30b3\u30df\u30c3\u30c8\u306b\u4f55\u304c\u542b\u307e\u308c\u308b\u304b\u3068\u3044\u3046\u60c5\u5831\u3002<\/p>\n<p><strong>origin \u30b5\u30fc\u30d0\u30fc<\/strong><br \/>\n\u30af\u30ed\u30fc\u30f3\u5143\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u5bfe\u3057\u3066 Git \u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u3064\u3051\u308b\u540d\u524d\u3002<\/p>\n<p><strong>master \u30d6\u30e9\u30f3\u30c1<\/strong><br \/>\n\u30af\u30ed\u30fc\u30f3\u3057\u305f\u5730\u70b9\u3067\u3053\u306e\u30d6\u30e9\u30f3\u30c1\u540d\u3068\u30b5\u30fc\u30d0\u30fc\u540d\u304c\u81ea\u52d5\u8a2d\u5b9a\u3055\u308c\u308b\u3002<\/p>\n<p><strong>HEAD \u30dd\u30a4\u30f3\u30bf<\/strong><br \/>\n\u4f5c\u696d\u4e2d\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u6307\u3057\u793a\u3059\u7279\u5225\u306a\u30dd\u30a4\u30f3\u30bf\u3002<br \/>\nGit \u3067\u306f\u3001HEAD \u306f\u4f5c\u696d\u3057\u3066\u3044\u308b\u30ed\u30fc\u30ab\u30eb\u30d6\u30e9\u30f3\u30c1\u3078\u306e\u30dd\u30a4\u30f3\u30bf\u3068\u306a\u308b\u3002<\/p>\n<p><strong>git clone<\/strong><br \/>\ngit clone \u30b3\u30de\u30f3\u30c9\u306f\u30ed\u30fc\u30ab\u30eb\u306e master \u30d6\u30e9\u30f3\u30c1\u304c\u3001(\u53d6\u5f97\u5143\u30b5\u30fc\u30d0\u30fc\u306e) \u30ea\u30e2\u30fc\u30c8\u306e master \u30d6\u30e9\u30f3\u30c1\u3092\u8ffd\u8de1\u3059\u308b\u3088\u3046\u81ea\u52d5\u8a2d\u5b9a\u3059\u308b\u3002<br \/>\n\u30ea\u30e2\u30fc\u30c8\u306b master \u30d6\u30e9\u30f3\u30c1\u304c\u5b58\u5728\u3059\u308b\u3053\u3068\u3092\u524d\u63d0\u3068\u3057\u3066\u3044\u308b\u3002<\/p>\n<p><strong>git pull<\/strong><br \/>\n\u901a\u5e38\u306f\u6700\u521d\u306b\u30af\u30ed\u30fc\u30f3\u3057\u305f\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3001\u73fe\u5728\u4f5c\u696d\u4e2d\u306e\u30b3\u30fc\u30c9\u3078\u306e\u30de\u30fc\u30b8\u3092\u8a66\u307f\u308b\u3002<\/p>\n<p><strong>\u30ea\u30d9\u30fc\u30b9<\/strong><br \/>\n\u4e00\u65b9\u306e\u30d6\u30e9\u30f3\u30c1\u306b\u30b3\u30df\u30c3\u30c8\u3055\u308c\u305f\u3059\u3079\u3066\u306e\u5909\u66f4\u3092\u3082\u3046\u4e00\u65b9\u306e\u30d6\u30e9\u30f3\u30c1\u3067\u518d\u73fe\u3059\u308b\u3002<\/p>\n<h4>\u30b3\u30de\u30f3\u30c9\u5165\u529b\u306b\u3064\u3044\u3066<\/h4>\n<p><strong>\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5<\/strong><br \/>\n$ git config &#8211;list<\/p>\n<p><strong>\u5909\u66f4\u3092\u78ba\u8a8d\u3059\u308b\u65b9\u6cd5<\/strong><br \/>\n$ git status<br \/>\n$ git diff<br \/>\n$ git diff &#8211;staged<\/p>\n<p><strong>git \u3067\u7ba1\u7406\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30df\u30c3\u30c8\u3059\u308b<\/strong><\/p>\n<pre lang=\"bash\" line=\"1\">\r\n$ git init\t\t\t\t\t# \u65e2\u5b58\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u306e\u521d\u671f\u5316\r\n$ git add *.c\t\t\t\t\t# \u7ba1\u7406\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3059\u308b\r\n$ git commit \u2013m 'initial project version'\t# \u30b3\u30df\u30c3\u30c8\u3059\u308b\r\n<\/pre>\n<p>\u30b9\u30c6\u30fc\u30b8\u30f3\u30b0\u30a8\u30ea\u30a2\u306e\u6e96\u5099\u304c\u3067\u304d\u305f\u3089\u3001\u5909\u66f4\u5185\u5bb9\u3092\u30b3\u30df\u30c3\u30c8\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<br \/>\n\u30b3\u30df\u30c3\u30c8\u306e\u5bfe\u8c61\u3068\u306a\u308b\u306e\u306f\u30b9\u30c6\u30fc\u30b8\u3055\u308c\u305f\u3082\u306e\u3060\u3051\u3001\u3064\u307e\u308a\u8ffd\u52a0\u3057\u305f\u308a\u5909\u66f4\u3057\u305f\u308a\u3057\u305f\u3060\u3051\u3067<br \/>\ngit add \u3092\u5b9f\u884c\u3057\u3066\u3044\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u306f\u30b3\u30df\u30c3\u30c8\u3055\u308c\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3002<\/p>\n<pre>\r\n$ git commit -a -m '...'\r\n<\/pre>\n<table>\n<tr>\n<td>$ git pull origin master<\/td>\n<td>\u30de\u30b9\u30bf\u306e\u6539\u5909\u3092\u53d6\u308a\u8fbc\u3080<\/td>\n<\/tr>\n<tr>\n<td>$ git branch<\/td>\n<td>\u73fe\u5728\u306e\u30d6\u30e9\u30f3\u30c1\u3092\u78ba\u8a8d\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git checkout (\u30d6\u30e9\u30f3\u30c1\u540d)<\/td>\n<td>\u30d6\u30e9\u30f3\u30c1\u3092\u5207\u308a\u63db\u3048\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git status<\/td>\n<td>\u30b3\u30df\u30c3\u30c8\u6b8b\u304c\u3042\u308b\u304b\u5224\u65ad\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git add (\u30d5\u30a1\u30a4\u30eb\u540d)<\/td>\n<td>\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git merge (\u30d6\u30e9\u30f3\u30c1\u540d)<\/td>\n<td>\u30d6\u30e9\u30f3\u30c1\u3092\u30de\u30fc\u30b8\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git push origin master<\/td>\n<td>origin\u30b5\u30fc\u30d0\u306emaster\u30d6\u30e9\u30f3\u30c1\u3078push\u3059\u308b<\/td>\n<\/tr>\n<\/table>\n<p><strong>\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3001\u5909\u66f4\u3059\u308b\u65b9\u6cd5<\/strong><\/p>\n<table>\n<tr>\n<td>$ git rm \u30d5\u30a1\u30a4\u30eb\u540d<\/td>\n<td>\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664\u304c\u30b9\u30c6\u30fc\u30b8\u3055\u308c\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git rm -f \u30d5\u30a1\u30a4\u30eb\u540d<\/td>\n<td>\u30b9\u30c6\u30fc\u30b8\u3055\u308c\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git rm &#8211;cached \u30d5\u30a1\u30a4\u30eb\u540d<\/td>\n<td>\u30d5\u30a1\u30a4\u30eb\u3092\u30b9\u30c6\u30fc\u30b8\u304b\u3089\u524a\u9664\u3059\u308b\u306e\u307f<\/td>\n<\/tr>\n<tr>\n<td>$ git mv file_from file_to<\/td>\n<td>\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5909\u66f4\u3059\u308b (\u30b9\u30c6\u30fc\u30b8\u304b\u3089\u524a\u9664\u3057\u3001\u65b0\u3057\u3044\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u30b9\u30c6\u30fc\u30b8\u3057\u3066\u304f\u308c\u308b)<\/td>\n<\/tr>\n<\/table>\n<p><strong>\u76f4\u8fd1\u306e\u30b3\u30df\u30c3\u30c8\u3092\u4fee\u6b63\u3059\u308b\u65b9\u6cd5<\/strong><\/p>\n<table>\n<tr>\n<td>$ git commit &#8211;amend<\/td>\n<td>\u76f4\u8fd1\u306e\u30b3\u30df\u30c3\u30c8\u3092\u5909\u66f4<\/td>\n<\/tr>\n<\/table>\n<p><strong>\u76f4\u8fd1\u306e\u30b3\u30df\u30c3\u30c8\u3092\u4fee\u6b63\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u69d8\u306b\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3059\u308b\u3002<\/strong><\/p>\n<pre lang=\"bash\" line=\"1\">\r\n$ git commit -m '\u521d\u671f\u30b3\u30df\u30c3\u30c8'\r\n$ git add \u5fd8\u308c\u3066\u305f\u30d5\u30a1\u30a4\u30eb\r\n$ git commit --amend\r\n<\/pre>\n<p><strong>\u30ed\u30b0\u3092\u53c2\u7167\u3059\u308b\u65b9\u6cd5<\/strong><\/p>\n<table>\n<tr>\n<td>$ git log<\/td>\n<td>\u30ed\u30b0\u306e\u95b2\u89a7<\/td>\n<\/tr>\n<tr>\n<td>$ git log \u2013p -2<\/td>\n<td>-p \u3067\u5404\u30b3\u30df\u30c3\u30c8\u306e diff \u3092\u8868\u793a\u3057\u3001-2 \u3067\u76f4\u8fd1\u306e 2 \u30a8\u30f3\u30c8\u30ea\u3060\u3051\u3092\u51fa\u529b\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git log &#8211;pretty=format:&#8221;%s&#8221; &#8211;graph<\/td>\n<td>\u30ed\u30b0\u3092\u30b0\u30e9\u30d5\u30a3\u30ab\u30eb\u306b\u51fa\u529b\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git log &#8211;oneline<\/td>\n<td>\u30ed\u30b0\u3092\uff11\u884c\u305a\u3064\u51fa\u529b\u3059\u308b<\/td>\n<\/tr>\n<\/table>\n<p><strong>\u30bf\u30b0\u3092\u3064\u3051\u308b\u65b9\u6cd5<\/strong><\/p>\n<table>\n<tr>\n<td>$ git tag<\/td>\n<td>\u30bf\u30b0\u306e\u4e00\u89a7\u8868\u793a<\/td>\n<\/tr>\n<tr>\n<td>$ git tag -a v1.4 -m &#8216;my version 1.4&#8217;<\/td>\n<td>\u6ce8\u91c8\u4ed8\u304d\u306e\u30bf\u30b0\u3092\u6307\u5b9a\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git show v1.4<\/td>\n<td>\u30bf\u30b0\u306e\u53c2\u7167<\/td>\n<\/tr>\n<\/table>\n<p><strong>\u30d6\u30e9\u30f3\u30c1\u3092\u64cd\u4f5c\u3059\u308b\u65b9\u6cd5<\/strong><\/p>\n<table>\n<tr>\n<td>$ git checkout testing<\/td>\n<td>\u30d6\u30e9\u30f3\u30c1\u3092 testing \u3078\u5207\u308a\u63db\u3048\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git checkout -b iss53<\/td>\n<td>\u30d6\u30e9\u30f3\u30c1 iss53 \u3092\u4f5c\u6210\u3057\u3066\u3001\u5207\u308a\u63db\u3048\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git checkout master<\/td>\n<td>\u30d6\u30e9\u30f3\u30c1\u3092 master \u3078\u5207\u308a\u63db\u3048\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git merge hotfix<\/td>\n<td>\u30d6\u30e9\u30f3\u30c1\u3092\u30de\u30fc\u30b8\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<td>$ git branch -d hotfix<\/td>\n<td>\u30d6\u30e9\u30f3\u30c1\u3092\u524a\u9664\u3059\u308b<\/td>\n<\/tr>\n<\/table>\n<p><strong>submodule \u3092\u66f4\u65b0\u3059\u308b\u65b9\u6cd5<\/strong><\/p>\n<table>\n<tr>\n<td>$ git submodule foreach &#8216;git checkout master; git pull&#8217;<\/td>\n<td>\u3059\u3079\u3066\u306e\u30b5\u30d6\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u66f4\u65b0\u3059\u308b<\/td>\n<\/tr>\n<tr>\n<\/table>\n<a href=\"https:\/\/twitter.com\/redwing1300?ref_src=twsrc%5Etfw\" class=\"twitter-follow-button\" data-size=\"large\" data-show-count=\"false\">Follow @redwing1300<\/a><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content --><div id=\"redwi-574925160\" class=\"redwi- redwi-entity-placement\"><script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-9652476346722993\" crossorigin=\"anonymous\"><\/script><ins class=\"adsbygoogle\" style=\"display:block;\" data-ad-client=\"ca-pub-9652476346722993\" \ndata-ad-slot=\"\" \ndata-ad-format=\"auto\"><\/ins>\n<script> \n(adsbygoogle = window.adsbygoogle || []).push({}); \n<\/script>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>git \u306b\u3064\u3044\u3066\u3088\u304f\u5206\u304b\u3063\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u8abf\u3079\u3066\u307f\u305f\u3002 \u3088\u304f\u5206\u304b\u3089\u306a\u304b\u3063\u305f\u539f\u56e0\u306f\u3001git \u7279\u6709\u306e\u6982\u5ff5\u3001\u7528\u8a9e\u306a\u3069\u306b\u3042\u3063\u305f\u3068\u611f\u3058\u3066\u3044\u305f\u306e\u3067\u3001\u4ee5\u4e0b\u306b\u307e\u3068\u3081\u305f\u3002 \u6982\u5ff5\u306b\u3064\u3044\u3066\u306f\u4ee5\u4e0b\u306e\u8cc7\u6599\u3092\u53c2\u7167\u3059\u308b\u306e\u304c\u3044\u3044\u3002 git &#038;#821 &hellip; <a href=\"https:\/\/redwing.moo.jp\/cocoa\/archives\/1245\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,5,4],"tags":[17],"class_list":["post-1245","post","type-post","status-publish","format-standard","hentry","category-unix_osx","category-xcode3","category-xcode4","tag-git"],"_links":{"self":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/1245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/comments?post=1245"}],"version-history":[{"count":43,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/1245\/revisions"}],"predecessor-version":[{"id":1277,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/posts\/1245\/revisions\/1277"}],"wp:attachment":[{"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/media?parent=1245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/categories?post=1245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redwing.moo.jp\/cocoa\/wp-json\/wp\/v2\/tags?post=1245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}