{"id":6022,"date":"2022-01-26T11:41:11","date_gmt":"2022-01-26T03:41:11","guid":{"rendered":"http:\/\/xinyiworld.top\/wordpress\/?p=6022"},"modified":"2022-02-18T14:49:33","modified_gmt":"2022-02-18T06:49:33","slug":"git-commit%e8%84%9a%e6%9c%ac","status":"publish","type":"post","link":"http:\/\/xinyiworld.top\/wordpress_it\/?p=6022","title":{"rendered":"Git commit\u811a\u672c"},"content":{"rendered":"<pre><code class=\"language-shell line-numbers\">#!\/bin\/bash\n# \u52a8\u4f5c\u540d\u79f0\u8f93\u5165\nprintf \"Step1:choose your action\uff0cintput the option number.\\n\nyou can choose \u65b0\u589e(1)\/\u4fee\u6539(2)\/\u5220\u9664(3)\\n\n\"\necho -e \"please input the right number: \\c\"\nread actionNum\n\ncase $actionNum in\n    1)  #echo '\u4f60\u9009\u62e9\u4e86 1' \n    actionName=\"\u65b0\u589e\"\n    ;;\n    2)  #echo '\u4f60\u9009\u62e9\u4e86 2'\n    actionName=\"\u4fee\u6539\"\n    ;;\n    3)  #echo '\u4f60\u9009\u62e9\u4e86 3'\n    actionName=\"\u5220\u9664\"\n    ;;\n    *)  \n    echo -e \"\\033[31m error:  \u8bf7\u9009\u62e91\u30012\u30013\u5f53\u4e2d\u7684\u67d0\u4e2a\u6570\u5b57! \\e\"\n    exit 0\n    ;;\nesac\n\n# \u529f\u80fd\u540d\u79f0\u8f93\u5165\necho -e \"Step2:please input your function name: \\c\"\nread functionName\nif test -z $functionName\nthen\n    echo -e \"\\033[31m error:  \u529f\u80fd\u540d\u79f0\u4e0d\u53ef\u4e3a\u7a7a \\e\"\n    exit 0\nfi\n\n# \u529f\u80fd\u63cf\u8ff0\necho -e \"Step3:please input your function description: \\c\"\nread functionDesc\nif test -z $functionDesc\nthen\n    echo -e \"\\033[31m error:  \u529f\u80fd\u63cf\u8ff0\u4e0d\u53ef\u4e3a\u7a7a \\e\"\n    exit 0\nfi\n\n# \u62fc\u63a5\u524d\u9762\u7684\u8f93\u5165\nstr_commit_msg=\"$actionName|$functionName|$functionDesc\"\ngit commit -m $str_commit_msg\n<\/code><\/pre>\n<p>\u5982\u679c\u901a\u8fc7\u811a\u672c\u4ece\u547d\u4ee4\u7ec8\u7aef\u8f93\u5165\u7684commit msg\u4e2d\u6587\u5728git log\u663e\u793a\u65f6\u4e71\u7801\uff0c\u53ef\u4ee5\u4f5c\u5982\u4e0b\u8bbe\u7f6e\uff1a<\/p>\n<pre><code class=\"language-bash line-numbers\">git config --global core.quotepath false\ngit config --global gui.encoding utf-8\ngit config --global i18n.commit.encoding utf-8\ngit config --global i18n.logoutputencoding utf-8\n<\/code><\/pre>\n<button class=\"simplefavorite-button\" data-postid=\"6022\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>#!\/bin\/bash # \u52a8\u4f5c\u540d\u79f0\u8f93\u5165 printf &#8220;Step1:choose your act [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[378],"tags":[],"_links":{"self":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/6022"}],"collection":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6022"}],"version-history":[{"count":3,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/6022\/revisions"}],"predecessor-version":[{"id":6084,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/6022\/revisions\/6084"}],"wp:attachment":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6022"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}