{"id":1619,"date":"2016-08-29T18:30:08","date_gmt":"2016-08-29T10:30:08","guid":{"rendered":"http:\/\/kaoru.tech\/?p=1619"},"modified":"2016-08-29T18:30:08","modified_gmt":"2016-08-29T10:30:08","slug":"frequently-used-git-command","status":"publish","type":"post","link":"http:\/\/kaoru.tech:7000\/wordpress\/?p=1619","title":{"rendered":"Frequently-used GIT command"},"content":{"rendered":"<p>clone\u4e00\u4e2arepo<\/p>\n<pre class=\"lang:sh decode:true\">git clone [http:\/\/][username]@url\/ip:\/path\/to\/project project<\/pre>\n<p>\u83b7\u53d6\u5e76\u4e14\u6574\u5408\u53e6\u5916\u4e00\u4e2arepos\u5230\u672c\u5730repos refs<\/p>\n<pre class=\"lang:sh decode:true\">git pull [option] [remote] [branch]<\/pre>\n<p>\u4e0a\u4f20\u672c\u5730repo branch\u5230remote branch<\/p>\n<pre class=\"lang:sh decode:true\">git push [option] [remote] [branch]\r\n\r\n[option]\r\n   -f      \u5f53local\u548cremote\u5206\u652f\u4e0d\u662f\u540c\u4e00\u7956\u5148\u65f6\u5f3a\u5236\u4f7f\u7528\u672c\u5730refs\u8986\u76d6remote\u5206\u652f<\/pre>\n<p>\u83b7\u53d6remote\u7684branch\u7684\u66f4\u65b0<\/p>\n<pre class=\"lang:sh decode:true\">git fetch [remote] [branch]<\/pre>\n<p>\u8bbe\u7f6elocal branch\u7684tracking remote branch<\/p>\n<pre class=\"lang:sh decode:true\">git branch --set-upstream-to=&lt;remote&gt;\/&lt;branch&gt; [local branch]<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>clone\u4e00\u4e2arepo git clone [http:\/\/][username]@url\/ip:\/path\/to\/project project \u83b7\u53d6\u5e76\u4e14\u6574\u5408\u53e6\u5916\u4e00\u4e2arepos\u5230\u672c\u5730repos refs git pull [option] [remote] [branch] \u4e0a\u4f20\u672c\u5730repo branch\u5230remote branch git push [option] [remote] [branch] [option] -f \u5f53local\u548cremote\u5206\u652f\u4e0d\u662f\u540c\u4e00\u7956\u5148\u65f6\u5f3a\u5236\u4f7f\u7528\u672c\u5730refs\u8986\u76d6remote\u5206\u652f \u83b7\u53d6remote\u7684branch\u7684\u66f4\u65b0 git fetch [remote] [branch] \u8bbe\u7f6elocal branch\u7684tracking&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[31],"tags":[214],"class_list":["post-1619","post","type-post","status-publish","format-standard","hentry","category-git","tag-git"],"_links":{"self":[{"href":"http:\/\/kaoru.tech:7000\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/kaoru.tech:7000\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/kaoru.tech:7000\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/kaoru.tech:7000\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/kaoru.tech:7000\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1619"}],"version-history":[{"count":2,"href":"http:\/\/kaoru.tech:7000\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1619\/revisions"}],"predecessor-version":[{"id":1621,"href":"http:\/\/kaoru.tech:7000\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1619\/revisions\/1621"}],"wp:attachment":[{"href":"http:\/\/kaoru.tech:7000\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/kaoru.tech:7000\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1619"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/kaoru.tech:7000\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}