{"id":93,"date":"2021-01-18T14:31:03","date_gmt":"2021-01-18T06:31:03","guid":{"rendered":"http:\/\/gjweb.top\/?p=93"},"modified":"2021-01-18T14:31:04","modified_gmt":"2021-01-18T06:31:04","slug":"git%e5%9f%ba%e6%9c%ac%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/gjweb.top\/?p=93","title":{"rendered":"Git\u57fa\u672c\u64cd\u4f5c"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u521b\u5efagit\u672c\u5730\u4ed3\u5e93<\/h2>\n\n\n\n<p>\u200b 1.\u521d\u59cb\u5316\u4ed3\u5e93 git init<\/p>\n\n\n\n<p>\u200b 2.\u6dfb\u52a0\u6587\u4ef6\u5230\u4ed3\u5e93 git add .<\/p>\n\n\n\n<p>\u200b 3.git commit -m &#8220;\u5907\u6ce8\u4fe1\u606f&#8221;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u67e5\u770b\u8fdc\u7a0b\u63d0\u4ea4\u65e5\u5fd7<\/h2>\n\n\n\n<p>\u200b git log<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u628a\u6587\u4ef6\u9000\u56de\u5230\u4e0a\u4e00\u4e2a\u7248\u672c<\/h2>\n\n\n\n<p>\u200b git reset &#8211;hard HEAD^<\/p>\n\n\n\n<p>\u200b 2.\u56de\u5230\u6700\u65b0\u7248\u672c<\/p>\n\n\n\n<p>\u200b git reset &#8211;hard id\u53f7<\/p>\n\n\n\n<p>\u200b 3.\u67e5\u770b\u5386\u53f2\u7684id\u53f7<\/p>\n\n\n\n<p>\u200b git reflog<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u67e5\u770b\u5de5\u4f5c\u533a\u72b6\u6001<\/h2>\n\n\n\n<p>\u200b git status<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e94\u3001\u64a4\u9500\u5de5\u4f5c\u533a\u7684\u4fee\u6539\u5230\u6700\u8fd1\u4e00\u6b21\u4e0a\u4f20<\/h2>\n\n\n\n<p>\u200b git checkout &#8212; \u6587\u4ef6\u540d\u79f0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u516d\u3001\u8fdc\u7a0b\u5efa\u5e93\u5e76\u4e0a\u4f20<\/h2>\n\n\n\n<p>\u200b git remote add origin git\u5730\u5740<\/p>\n\n\n\n<p>\u200b git push -u origin \u5206\u652f\u540d<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e03\u3001\u8fdc\u7a0b\u5e93\u514b\u9686<\/h2>\n\n\n\n<p>\u200b git clone git\u5730\u5740<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u516b\u3001\u521b\u5efa\u5206\u652f\u5e76\u5207\u6362\u5206\u652f<\/h2>\n\n\n\n<p>\u200b git checkout -b \u5206\u652f\u540d<\/p>\n\n\n\n<p>\u200b \u5206\u89e3\u4e3a<\/p>\n\n\n\n<p>\u200b \u521b\u5efa\u5206\u652f\uff1agit branch \u5206\u652f\u540d<\/p>\n\n\n\n<p>\u200b \u5207\u6362\u5206\u652f\uff1agit checkout \u5206\u652f\u540d<\/p>\n\n\n\n<p>\u200b 2.\u68c0\u67e5\u5f53\u524d\u5206\u652f\uff1a<\/p>\n\n\n\n<p>\u200b git branch<\/p>\n\n\n\n<p>\u200b 3.\u5408\u5e76\u5206\u652f<\/p>\n\n\n\n<p>\u200b git merge \u5206\u652f\u540d<\/p>\n\n\n\n<p>\u200b 4.\u5220\u9664\u5206\u652f<\/p>\n\n\n\n<p>\u200b git branch -d \u5206\u652f\u540d<\/p>\n\n\n\n<p>\u200b<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e5d\u3001 \u89e3\u51b3\u51b2\u7a81<\/h2>\n\n\n\n<p>\u200b 1.\u67e5\u770b\u51b2\u7a81\u6587\u4ef6 git status<\/p>\n\n\n\n<p>\u200b 2.\u67e5\u770b\u5206\u652f\u5408\u5e76\u56fe git log &#8211;graph<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u3001\u4e34\u65f6\u50a8\u5b58\u5206\u652f<\/h2>\n\n\n\n<p>\u200b git stash<\/p>\n\n\n\n<p>\u200b 1.\u6062\u590d\u4e34\u65f6\u50a8\u5b58\u5206\u652f<\/p>\n\n\n\n<p>\u200b 1.1:\u67e5\u770b\u50a8\u5b58\u7684id<\/p>\n\n\n\n<p>\u200b git stash list<\/p>\n\n\n\n<p>\u200b 1.2:\u6062\u590d\u50a8\u5b58\u5206\u652f\uff08\u4e24\u79cd\u65b9\u6cd5\uff09<\/p>\n\n\n\n<p>\u200b 1.2.3\u65b9\u6cd5\u4e00:<\/p>\n\n\n\n<p>\u200b \u6062\u590d\uff1agit stash apply id\u540d \u5982stash@{0}<\/p>\n\n\n\n<p>\u200b \u5220\u9664\uff1agit stash drop<\/p>\n\n\n\n<p>\u200b 1.2.3\u65b9\u6cd5\u4e8c\uff1a<\/p>\n\n\n\n<p>\u200b \u81ea\u52a8\u6062\u590d\u5220\u9664\uff1a<\/p>\n\n\n\n<p>\u200b git stash pop<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e00\u3001\u67e5\u770b\u8fdc\u7a0b\u5e93\u4fe1\u606f<\/h2>\n\n\n\n<p>\u200b git remote<\/p>\n\n\n\n<p>\u200b \u67e5\u770b\u8be6\u7ec6\u4fe1\u606f<\/p>\n\n\n\n<p>\u200b git remote -v<\/p>\n\n\n\n<p>\u200b \u6ce8\uff1a\u5982\u679c\u6ca1\u6709\u63a8\u9001\u6743\u9650\uff0c\u5c31\u770b\u4e0d\u5230push\u7684\u5730\u5740<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e8c \u3001 \u63a8\u9001\u5206\u652f<\/h2>\n\n\n\n<p>\u200b git push origin \u5206\u652f\u540d<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5341\u4e09\u3001\u591a\u4eba\u534f\u4f5c\u4e2d\u7684\u95ee\u9898<\/h2>\n\n\n\n<p>\u200b 1.git pull \u5931\u8d25 \u63d0\u793ano tracking information<\/p>\n\n\n\n<p>\u200b \u539f\u56e0\uff1a\u6ca1\u6709\u6307\u5b9a\u672c\u5730\u5206\u652f\u4e0e\u8fdc\u7a0b\u5206\u652f\u8fde\u63a5<\/p>\n\n\n\n<p>\u200b \u89e3\u51b3\uff1a git branch \u3010&#8211;set-upstream \u672c\u5730\u5206\u652f \u8fdc\u7a0b\u5206\u652f\u3011<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u521b\u5efagit\u672c\u5730\u4ed3\u5e93 \u200b 1.\u521d\u59cb\u5316\u4ed3\u5e93 git init \u200b 2.\u6dfb\u52a0\u6587\u4ef6\u5230\u4ed3\u5e93 git add . \u200b  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-93","post","type-post","status-publish","format-standard","hentry","category-git"],"_links":{"self":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=93"}],"version-history":[{"count":0,"href":"https:\/\/gjweb.top\/index.php?rest_route=\/wp\/v2\/posts\/93\/revisions"}],"wp:attachment":[{"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gjweb.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}