{"id":318686,"date":"2021-02-05T01:50:11","date_gmt":"2021-02-04T17:50:11","guid":{"rendered":"http:\/\/4563.org\/?p=318686"},"modified":"2021-02-05T01:50:11","modified_gmt":"2021-02-04T17:50:11","slug":"git-%e5%91%bd%e4%bb%a4%e5%a4%87%e5%bf%98%e7%b3%bb%e5%88%97%ef%bc%88%e4%b8%80%ef%bc%89%ef%bc%9a%e5%9f%ba%e7%a1%80%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=318686","title":{"rendered":"git \u547d\u4ee4\u5907\u5fd8\u7cfb\u5217\uff08\u4e00\uff09\uff1a\u57fa\u7840\u547d\u4ee4"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  git \u547d\u4ee4\u5907\u5fd8\u7cfb\u5217\uff08\u4e00\uff09\uff1a\u57fa\u7840\u547d\u4ee4               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : raikay <\/span>  <span><i><\/i> 9<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<h3>1 \u3001\u514b\u9686\u9879\u76ee\u5230\u672c\u5730<\/h3>\n<pre><code>git clone https:\/\/github.com\/raikay\/gittest.git <\/code><\/pre>\n<h3>2 \u3001\u62c9\u53d6\u6700\u65b0<\/h3>\n<pre><code>git pull  <\/code><\/pre>\n<h3>3 \u3001\u6dfb\u52a0\u6587\u4ef6\u5230\u6682\u5b58\u533a<\/h3>\n<pre><code>git add \u6587\u4ef6\u540d  # \u6307\u5b9a\u6587\u4ef6\u3002 git add .      # \u5c06\u5f53\u524d\u5de5\u4f5c\u533a\u7684\u6240\u6709\u6587\u4ef6\u90fd\u52a0\u5165\u6682\u5b58\u533a <\/code><\/pre>\n<h3>4 \u3001\u5c06\u7f13\u5b58\u533a\u7684\u5185\u5bb9\u63d0\u4ea4\u5230\u672c\u5730\u4ed3\u5e93<\/h3>\n<pre><code>git commit -m \"\u63d0\u4ea4\u8bf4\u660e\" git commit --amend    #\u8ffd\u52a0 \/\u4fee\u6539\u4e0a\u6b21\u63d0\u4ea4\u3001\u4e0d\u65b0\u589e\u63d0\u4ea4\u8bb0\u5f55 <\/code><\/pre>\n<h3>5 \u3001\u67e5\u770b\u5de5\u4f5c\u533a\u4e0e\u7f13\u5b58\u533a\u7684\u72b6\u6001\u300c git status \u300d<\/h3>\n<pre><code>git status <\/code><\/pre>\n<h3>6 \u3001\u63a8\u9001\u5230\u8fdc\u7a0b\u5206\u652f<\/h3>\n<pre><code>git push git push origin branch1 #\u591a\u4e2a\u4ed3\u5e93\u65f6\uff0c\u6307\u5b9a origin \u4ed3\u5e93\u4e0b branch1 \u5206\u652f <\/code><\/pre>\n<h3>7 \u3001\u83b7\u53d6\u5e2e\u52a9 \u300c help \u300d<\/h3>\n<pre><code>git \u547d\u4ee4 -h      <\/code><\/pre>\n<h3>8 \u3001\u5f3a\u5236\u8986\u76d6\u672c\u5730<\/h3>\n<pre><code>\/\/ \u4ece\u8fdc\u7a0b\u4ed3\u5e93\u4e0b\u8f7d\u6700\u65b0\u7248\u672c git fetch -all  \/\/ \u5c06\u672c\u5730\u8bbe\u4e3a\u521a\u83b7\u53d6\u7684\u6700\u65b0\u7684\u5185\u5bb9 git reset --hard origin\/master <\/code><\/pre>\n<h3>9 \u3001\u672c\u5730\u5df2\u6709\u9879\u76ee \u521d\u59cb\u5316\u64cd\u4f5c<\/h3>\n<ol>\n<li>\u521d\u59cb\u5316\u57fa\u7840\u6587\u4ef6\uff1a<code>git init<\/code> <\/li>\n<li>\u6dfb\u52a0\u5230\u6682\u5b58\u533a\uff1a<code>git add .<\/code> <\/li>\n<li>\u63d0\u4ea4\u5230\u672c\u5730\u4ed3\u5e93\uff1a<code>git commit -m 'init'<\/code> <\/li>\n<li>\u6dfb\u52a0\u8fdc\u7a0b\u8fdc\u7a0b\u4ed3\u5e93\u5730\u5740\uff1a<code>git remote add origin https:\/\/github.com\/raikay\/gittest.git<\/code><\/li>\n<li>\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff1a<code>git push -u origin master<\/code> <\/li>\n<\/ol>\n<blockquote>\n<p><code>-u<\/code>\uff1a\u521b\u5efa upStream \u4e0a\u4f20\u6d41\uff0c\u53ea\u5728\u521d\u6b21\u63a8\u9001\u4ee3\u7801\u65f6\u521b\u5efa\uff0c\u4ee5\u540e\u5c31\u4e0d\u7528\u52a0<code>-u<\/code>\u53c2\u6570\u4e86<\/p>\n<\/blockquote>\n<h4>\u76f8\u5173\u6587\u7ae0<\/h4>\n<p>git \u547d\u4ee4\u5907\u5fd8\u7cfb\u5217\uff08\u4e00\uff09\uff1a\u57fa\u7840\u547d\u4ee4<br \/> git \u547d\u4ee4\u5907\u5fd8\u7cfb\u5217\uff08\u4e8c\uff09\uff1a\u914d\u7f6e\u6587\u4ef6\u64cd\u4f5c\uff08 config \uff09<br \/> git \u547d\u4ee4\u5907\u5fd8\u7cfb\u5217\uff08\u4e09\uff09\uff1a\u67e5\u770b\u5386\u53f2\u8bb0\u5f55\uff08 log \uff09<br \/> git \u547d\u4ee4\u5907\u5fd8\u7cfb\u5217\uff08\u56db\uff09\uff1a\u5bf9\u6bd4\u4e24\u4e2a\u5206\u652f\u7684\u5dee\u5f02\uff08 diff \uff09<br \/> git \u547d\u4ee4\u5907\u5fd8\u7cfb\u5217\uff08\u4e94\uff09\uff1a\u6062\u590d\u4e0e\u64a4\u9500\uff08 reset \uff09<br \/> git \u547d\u4ee4\u5907\u5fd8\u7cfb\u5217\uff08\u516d\uff09\uff1a\u5206\u652f\u64cd\u4f5c\uff08 branch \uff09<br \/> git \u547d\u4ee4\u5907\u5fd8\u7cfb\u5217\uff08\u4e03\uff09\uff1a\u6807\u7b7e\u64cd\u4f5c\uff08 tag \uff09<br \/> git \u547d\u4ee4\u5907\u5fd8\u7cfb\u5217\uff08\u516b\uff09\uff1a\u4f7f\u7528\u6280\u5de7\u96c6\u5408<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>0<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>git \u547d\u4ee4\u5907\u5fd8\u7cfb\u5217\uff08\u4e00\uff09\uff1a\u57fa\u7840\u547d&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/318686"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=318686"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/318686\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=318686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=318686"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=318686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}