{"id":10006846,"date":"2022-11-17T00:00:39","date_gmt":"2022-11-16T16:00:39","guid":{"rendered":"https:\/\/ityet.com\/?p=10006846"},"modified":"2022-11-17T00:00:39","modified_gmt":"2022-11-16T16:00:39","slug":"git%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006846","title":{"rendered":"git\u547d\u4ee4"},"content":{"rendered":"<p><strong>1\u3001git\u521b\u5efa\u65b0\u5206\u652f<\/strong><\/p>\n<pre><code>git branch;     \/\/\u67e5\u770b\u4e00\u4e0b\u672c\u5730\u5206\u652f\ngit branch -a  \/\/\u67e5\u770b\u672c\u5730\u548c\u8fdc\u7a0b\u7684\u6240\u6709\u5206\u652f\ngit branch -b newbranch  \/\/\u65b0\u5efa\u5206\u652f\uff0c\u5e76\u5207\u6362\u5230\u8be5\u5206\u652f\ngit push --set-upstream origin newbranch  \u8fdc\u7a0b\u5206\u652f\u521b\u5efa\u6210\u529f<\/code><\/pre>\n<p><strong>2\u3001\u6682\u5b58\u4ee3\u7801<\/strong><\/p>\n<pre><code>git stash \/\/\u6682\u5b58\u672c\u5730\u4fee\u6539\u7684\u4ee3\u7801\ngit stash show \/\/\u67e5\u770b\u521a\u624d\u6682\u5b58\u7684\u4fee\u6539\ngit stash pop \/\/\u53d6\u51fa\u4fee\u6539<\/code><\/pre>\n<p><strong>3\u3001\u5220\u9664\u8fdc\u7a0b\u5206\u652f<\/strong><\/p>\n<pre><code> git push origin --delete [branch_name]\u201d<\/code><\/pre>\n<p><strong>4\u3001\u540c\u6b65\u8fdc\u7a0b\u5206\u652f<\/strong><\/p>\n<pre><code> git fetch   #\u5c06\u67d0\u4e2a\u8fdc\u7a0b\u4e3b\u673a\u7684\u66f4\u65b0\uff0c\u5168\u90e8\u53d6\u56de\u672c\u5730<\/code><\/pre>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000042779838\">https:\/\/segmentfault.com\/a\/1190000042779838<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001git\u521b\u5efa\u65b0\u5206\u652f git branch; \/\/\u67e5\u770b\u4e00\u4e0b\u672c\u5730\u5206\u652f git branch -a \/\/\u67e5\u770b\u672c\u5730\u548c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10006846","post","type-post","status-publish","format-standard","hentry","category-share"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006846","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"}],"author":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006846"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006846\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}