{"id":10006327,"date":"2022-08-26T22:33:57","date_gmt":"2022-08-26T14:33:57","guid":{"rendered":"https:\/\/ityet.com\/?p=10006327"},"modified":"2022-08-26T22:33:57","modified_gmt":"2022-08-26T14:33:57","slug":"%e4%bb%8e%e9%9b%b6%e5%bc%80%e5%a7%8b%ef%bc%8c%e7%94%a8elementui%e8%ba%ba%e5%9d%91vue-git","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006327","title":{"rendered":"\u4ece\u96f6\u5f00\u59cb\uff0c\u7528elementui\u8eba\u5751vue &#8211; git"},"content":{"rendered":"<p>Git \u662f\u6700\u6d41\u884c\u7684\u7248\u672c\u7ba1\u7406\u5de5\u5177\uff0c\u4e5f\u662f\u7a0b\u5e8f\u5458\u7684\u5fc5\u5907\u6280\u80fd\u4e4b\u4e00\u3002\u968f\u7740github,coding\u7b49\u4e00\u4e9b\u53ef\u4ee5\u4f7f\u7528git\u5b58\u50a8\u7684\u7f51\u7ad9\u76db\u884c\uff0cGit\u7684\u6c5f\u6e56\u5730\u4f4d\u53d8\u5f97\u65e0\u53ef\u66ff\u4ee3\u4e86\uff0c\u5982\u679c\u4f60\u662f\u4e2a\u5f00\u53d1\u8005\u5374\u8fd8\u4e0d\u4f1a\u4f7f\u7528Git\u90a3\u5c31\u592aout\u4e86\u3002<\/p>\n<p>\u9996\u5148\uff0c\u5c0f\u7f16\u5148\u5f15\u5165\u4e00\u5f20\u56fe\u6765\u89e3\u91cagit\u3002\u641e\u61c2\u540e\uff0c\u65e5\u5e38\u4f7f\u7528\u53ea\u97006\u5927\u547d\u4ee4\u5373\u53ef\u3002<\/p>\n<h3>1. \u56fe\u89e3git\u539f\u7406<\/h3>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc10z0\" alt=\"image.png\" title=\"image.png\" loading=\"lazy\"><\/p>\n<h4>1. Workspace: \u5de5\u4f5c\u533a<\/h4>\n<p>git add . \u547d\u4ee4\u5c06\u6539\u52a8\u63d0\u4ea4\u5230\u6682\u5b58\u533a<br \/>git pull \u547d\u4ee4\u5c06\u8fdc\u7a0b\u4ed3\u5e93\u7684\u6570\u636e\u62c9\u5230\u5f53\u524d\u5206\u652f\u5408\u5e76<br \/>git checkout master \u5207\u6362\u5206\u652f<\/p>\n<h4>2. Index \/ Stage: \u6682\u5b58\u533a<\/h4>\n<p>commit -m &#8216;init&#8217; \u5c06\u6539\u52a8\u63d0\u4ea4\u5230\u5f53\u524d\u5206\u652f\u5230\u672c\u5730\u4ed3\u5e93<\/p>\n<h4>3. Repository: \u672c\u5730\u4ed3\u5e93\uff08\u4ed3\u5e93\u533a\uff09<\/h4>\n<p>git push -u origin master \u63d0\u4ea4\u5230\u8fdc\u7a0b\u4ed3\u5e93<br \/>git clone git\u5730\u5740 \u5c06\u8fdc\u7a0b\u4ed3\u5e93\u514b\u9686\u5230\u672c\u5730<\/p>\n<h4>4. Remote: \u8fdc\u7a0b\u4ed3\u5e93\u533a<\/h4>\n<h3>2. git\u5e38\u89c1\u672f\u8bed<\/h3>\n<h4>1. \u4ed3\u5e93 Repository<\/h4>\n<p>\u4ed3\u5e93\u5305\u542b\u4e86\u6240\u6709\u7684\u7248\u672c\u4fe1\u606f\uff0c\u6240\u6709\u7684\u5206\u652f\u548c\u6807\u8bb0\u4fe1\u606f\u3002<\/p>\n<h4>2. \u5206\u652f Branches<\/h4>\n<p>\u4e00\u4e2a\u5206\u652f\u610f\u5473\u7740\u4e00\u4e2a\u72ec\u7acb\u7684\u3001\u62e5\u6709\u81ea\u5df1\u5386\u53f2\u4fe1\u606f\u7684\u4ee3\u7801\u7ebf\u3002\u9ed8\u8ba4\u7684\u5206\u652f\u662fmaster\u5206\u652f\u3002<br \/><strong>git branch<\/strong>: \u67e5\u770b\u5f53\u524d\u5206\u652f<br \/><strong>git checkout<\/strong>: \u5207\u6362\/\u521b\u5efa\u5206\u652f<\/p>\n<h4>3. \u6807\u8bb0 Tags<\/h4>\n<p>\u6807\u8bb0\u6307\u7684\u662f\u67d0\u4e2a\u5206\u652f\u7279\u5b9a\u65f6\u95f4\u7684\u72b6\u6001\u3002\u901a\u8fc7\u6807\u8bb0\uff0c\u53ef\u4ee5\u65b9\u4fbf\u7684\u5207\u6362\u5230\u6807\u8bb0\u65f6\u7684\u72b6\u6001<\/p>\n<h4>4. \u63d0\u4ea4 Commit<\/h4>\n<p>\u63d0\u4ea4\u4ee3\u7801\u540e\uff0c\u4ed3\u5e93\u4f1a\u751f\u6210\u4e00\u4e2a\u65b0\u7684\u63d0\u4ea4\u8bb0\u5f55\u3002<br \/><strong>git log<\/strong>: \u67e5\u770b\u63d0\u4ea4\u7684\u8bb0\u5f55<\/p>\n<h4>5. \u4fee\u8ba2 Revision<\/h4>\n<p>\u7528\u6765\u8868\u793a\u4ee3\u7801\u7684\u7248\u672c\u72b6\u6001<\/p>\n<h4>3. git\u5de5\u5177<\/h4>\n<blockquote>\n<p>Github Desktop\uff1a \u652f\u6301mac\u548cwindows<br \/><a href=\"https:\/\/link.segmentfault.com\/?enc=OEb5q1UKPsfwQ4aBKhf4ZA%3D%3D.%2B00m4h5DlNeI65Jg0stMG0CwBgwBqBEsShVadE6QJVY%3D\" rel=\"nofollow\">https:\/\/desktop.github.com\/<\/a><\/p>\n<p>\u5c0f\u4e4c\u9f9f\uff1atortoise\uff1a \u53ea\u652f\u6301Windows<br \/><a href=\"https:\/\/link.segmentfault.com\/?enc=ZgOS%2FpFXkflfFz9rwnWFbQ%3D%3D.4qMWsIW245dWeT71mg7WclgspSvQQpU%2B36dc%2BhkfIenkSG8cqyOMcLQX%2BB3ShYGx\" rel=\"nofollow\">http:\/\/download.tortoisegit.o&#8230;<\/a><\/p>\n<\/blockquote>\n<h4>4. git\u5e38\u89c1\u547d\u4ee4<\/h4>\n<h4>1. add<\/h4>\n<blockquote><p>git add .<\/p><\/blockquote>\n<p>\u5c06\u672c\u5730\u6240\u6709\u7684untrack\u6587\u4ef6\u90fd\u52a0\u5165\u5230\u6682\u5b58\u533a\uff0c\u5e76\u4e14\u6839\u636e<br \/>.gitignore\u505a\u8fc7\u6ee4\u64cd\u4f5c<\/p>\n<h4>2. commit<\/h4>\n<blockquote><p>git commit -m &#8216;message&#8217;<\/p><\/blockquote>\n<p>\u5c06\u6682\u5b58\u533a\u6587\u4ef6\u63d0\u4ea4\u5230\u672c\u5730\u4ed3\u5e93<\/p>\n<h4>3. remote<\/h4>\n<blockquote><p>git remote add origin <a href=\"https:\/\/segmentfault.com\/a\/mailto:git@github.com\">git@github.com<\/a><\/p><\/blockquote>\n<p>\u4e3a\u8fdc\u7a0b\u4ed3\u5e93\u66f4\u540d\u4e3aorigin<\/p>\n<h4>4. push<\/h4>\n<blockquote><p>git push -u origin master<\/p><\/blockquote>\n<p>\u5c06\u672c\u5730\u4ed3\u5e93\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93<\/p>\n<h4>5. pull<\/h4>\n<blockquote><p>git pull origin master<\/p><\/blockquote>\n<p>\u62c9\u53d6\u8fdc\u7a0b\u4ed3\u5e93\u6570\u636e\u5e76\u5408\u5e76\u5230\u5f53\u524d\u5206\u652f<\/p>\n<h4>6. branch<\/h4>\n<blockquote><p>git branch<\/p><\/blockquote>\n<p>\u5217\u51fa\u6240\u6709\u672c\u5730\u5206\u652f<\/p>\n<blockquote><p>git branch -r<\/p><\/blockquote>\n<p>\u5217\u51fa\u6240\u6709\u8fdc\u7a0b\u5206\u652f<\/p>\n<blockquote><p>git branch -a<\/p><\/blockquote>\n<p>\u5217\u51fa\u6240\u6709\u672c\u5730\u5206\u652f\u548c\u8fdc\u7a0b\u5206\u652f<\/p>\n<blockquote><p>git branch [branch]<\/p><\/blockquote>\n<p>\u65b0\u5efa\u5206\u652f\uff0c\u4f46\u4ecd\u7136\u505c\u7559\u5728\u5f53\u524d\u5206\u652f<\/p>\n<h4>7. checkout<\/h4>\n<blockquote><p>git checkout -b [branch]<\/p><\/blockquote>\n<p>\u65b0\u5efa\u4e00\u4e2a\u5206\u652f\uff0c\u5e76\u5207\u6362\u5230\u8be5\u5206\u652f<\/p>\n<blockquote><p>git branch -d [branch]<\/p><\/blockquote>\n<p>\u5220\u9664\u672c\u5730\u5206\u652f<\/p>\n<blockquote><p>git push origin &#8211;delete [branch]<br \/>git branch -dr [branch]<\/p><\/blockquote>\n<h4>8. tag<\/h4>\n<blockquote><p>git tag<\/p><\/blockquote>\n<p>\u5217\u51fa\u6240\u6709\u7684tag<\/p>\n<blockquote><p>git tag [tag]<\/p><\/blockquote>\n<p>\u65b0\u5efatag\u6807\u7b7e\uff0c\u9ed8\u8ba4\u662f\u5f53\u524d\u5206\u652f<\/p>\n<blockquote><p>git tag -d [tag]<\/p><\/blockquote>\n<p>\u5220\u9664\u672c\u5730tag<\/p>\n<blockquote><p>git push origin :refs\/tags[tag]<\/p><\/blockquote>\n<p>\u5220\u9664\u8fdc\u7a0b\u5206\u652f<\/p>\n<blockquote><p>git push [romote] [tag]<\/p><\/blockquote>\n<p>\u63d0\u4ea4\u6307\u5b9atag<\/p>\n<blockquote><p>git push [romote] &#8211;tags<\/p><\/blockquote>\n<p>\u63d0\u4ea4\u6240\u6709tag<\/p>\n<blockquote><p>git checkout -b [branch] [tag]<\/p><\/blockquote>\n<p>\u65b0\u5efa\u4e00\u4e2a\u5206\u652f\uff0c\u6307\u5411tag<\/p>\n<h4>9. reset<\/h4>\n<blockquote><p>git reset &#8211;hard HEAD^<\/p><\/blockquote>\n<p>\u56de\u9000\u5230\u4e0a\u4e00\u7248\u672c<\/p>\n<blockquote><p>git reset &#8211;hard [commit]<\/p><\/blockquote>\n<p>\u56de\u9000\u5230\u6307\u5b9acommit\u7248\u672c<\/p>\n<h4>10. log<\/h4>\n<blockquote><p>git log<\/p><\/blockquote>\n<p>\u663e\u793a\u5f53\u524d\u5206\u652f\u7684\u6240\u6709\u7248\u672c\u5386\u53f2<\/p>\n<blockquote><p>git log &#8211;stat<\/p><\/blockquote>\n<p>\u663e\u793a\u6240\u6709commit\u5386\u53f2\uff0c\u53cacommit\u53d8\u66f4\u7684\u6587\u4ef6<\/p>\n<blockquote><p>git log -p [file]<\/p><\/blockquote>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000042385548\">https:\/\/segmentfault.com\/a\/1190000042385548<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Git \u662f\u6700\u6d41\u884c\u7684\u7248\u672c\u7ba1\u7406\u5de5\u5177\uff0c\u4e5f\u662f\u7a0b\u5e8f\u5458\u7684\u5fc5\u5907\u6280\u80fd\u4e4b\u4e00\u3002\u968f\u7740github,coding\u7b49\u4e00\u4e9b\u53ef\u4ee5\u4f7f\u7528git\u5b58 [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-10006327","post","type-post","status-publish","format-standard","hentry"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006327"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006327\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}