{"id":432790,"date":"2021-04-18T14:19:52","date_gmt":"2021-04-18T06:19:52","guid":{"rendered":"http:\/\/4563.org\/?p=432790"},"modified":"2021-04-18T14:19:52","modified_gmt":"2021-04-18T06:19:52","slug":"git-%e4%bb%93%e5%ba%93%e5%90%8c%e6%ad%a5%e5%88%b0%e5%9d%9a%e6%9e%9c%e4%ba%91%e4%b8%8a%e5%90%8e%e6%8d%9f%e5%9d%8f%e4%ba%86","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=432790","title":{"rendered":"git \u4ed3\u5e93\u540c\u6b65\u5230\u575a\u679c\u4e91\u4e0a\u540e\u635f\u574f\u4e86"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  git \u4ed3\u5e93\u540c\u6b65\u5230\u575a\u679c\u4e91\u4e0a\u540e\u635f\u574f\u4e86               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : EscYezi <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u524d\u4e24\u5929\u5728\u5bb6\u91cc\u7684 windows \u7b14\u8bb0\u672c\u4e0a<code>git init --bare<\/code>\u65b0\u5efa\u4e86\u4e00\u4e2a\u4ed3\u5e93\uff0c\u7136\u540e\u628a\u8fd9\u4e2a\u6587\u4ef6\u5939\u540c\u6b65\u5230\u4e86\u575a\u679c\u4e91\u4e0a\uff0c\u5e76\u4e14\u5411\u8fd9\u4e2a\u4ed3\u5e93\u91cc push \u4e86\u4e00\u4e9b\u4ee3\u7801\u3002 \u6628\u5929\u5728\u516c\u53f8\u7684 mac \u4e0a\u7528\u575a\u679c\u4e91\u628a\u8fd9\u4e2a\u6587\u4ef6\u5939\u540c\u6b65\u4e0b\u6765\u7136\u540e<code>git clone<\/code>\u5230\u672c\u5730\uff0c\u5e76\u5411\u4ed3\u5e93 push \u4e86\u4e00\u4e9b\u4ee3\u7801\uff0c\u770b\u575a\u679c\u4e91\u540c\u6b65\u7ed3\u675f\u5408\u4e0a\u7535\u8111\u4e0b\u73ed\u4e86\u3002\u5230\u8fd9\u91cc\u4e3a\u6b62\u90fd\u6ca1\u53d1\u73b0\u4ec0\u4e48\u5f02\u5e38\u3002 \u4eca\u5929\u5728\u5bb6\u7528\u575a\u679c\u4e91\u628a\u4ed3\u5e93\u540c\u6b65\u4e0b\u6765\uff0c\u672c\u5730 pull \u53d1\u73b0\u62a5\u9519\u4e86\uff0c\u5177\u4f53\u9519\u8bef\u4fe1\u606f\u6ca1\u6709\u8bb0\u5f55\u4e0b\u6765\uff0c\u6362\u4e86\u4e00\u4e2a\u76ee\u5f55 clone \u62a5\u9519<\/p>\n<pre><code>D:projects&gt;git clone file:\/\/\/D:\/nutstore-sync\/git\/algorithm al2 -b main Cloning into 'al2'... remote: errorerror: git upload-pack: git-pack-objects died with error. fatal: git upload-pack: aborting due to possible repository corruption on the remote side. : Could not read 757adde25527ab466f2d48f3ae71ca1464b6df1ffatal: early EOF  remote: fatal: Failed to traverse parents of commit d26c516d98ef670e228eae36363bd015056b1283 remote: aborting due to possible repository corruption on the remote side. fatal: fetch-pack: invalid index-pack output <\/code><\/pre>\n<p>\u8fdb\u5230\u4ed3\u5e93\u91cc<code>fsck<\/code>\u4e86\u4e00\u4e0b<\/p>\n<pre><code>D:nutstore-syncgitalgorithm&gt;git fsck --name-object Checking object directories: 100% (256\/256), done. broken link from  commit d26c516d98ef670e228eae36363bd015056b1283 (refs\/heads\/main)               to  commit 757adde25527ab466f2d48f3ae71ca1464b6df1f (refs\/heads\/main^) broken link from    tree 07e1bf67bee247eb4db40fa135f705dd05fa8972 (refs\/heads\/main:src\/xxx\/xxxxx\/algorithm\/)               to    tree 8e30aad2ed2800aeed6c801b4b94d8847deb323a (refs\/heads\/main:src\/xxx\/xxxxx\/algorithm\/foroffer\/) missing tree 8e30aad2ed2800aeed6c801b4b94d8847deb323a (refs\/heads\/main:src\/xxx\/xxxxx\/algorithm\/foroffer\/) dangling tree 0f705bbff03e60514e46a060c4d61684582a55db dangling blob 39408c376bd54f576a653b79fd899f37452fe4af dangling tree cf04f6b34931f215f460332cbd0029669b9c60da dangling tree e3170836338f688d7bd1d12f85cde4ec7705cf6d dangling commit f1180ef1b7f4e924ecfbfd71bf05f0cea5c53367 missing commit 757adde25527ab466f2d48f3ae71ca1464b6df1f (refs\/heads\/main^) <\/code><\/pre>\n<p>\u641c\u4e86\u534a\u5929\uff0c\u627e\u5230\u7684\u6062\u590d\u65b9\u6cd5\u90fd\u662f\u5148\u8981\u6709\u4e00\u4e2a\u5b8c\u6574\u7684\u4ed3\u5e93\uff0c\u5728\u6b64\u57fa\u7840\u4e0a\u5bf9\u635f\u574f\u7684\u4ed3\u5e93\u8fdb\u884c\u4fee\u590d\u3002\u4f46\u662f\u73b0\u5728\u7684\u60c5\u51b5\u76f8\u5f53\u4e8e\u8fdc\u7a0b\u4ed3\u5e93\u635f\u574f\u4e86\uff0c\u6709\u6700\u65b0\u63d0\u4ea4\u7684\u672c\u5730\u4ed3\u5e93\u53c8\u5728\u516c\u53f8\u7684\u7535\u8111\u4e0a\uff0c\u60f3\u7740\u4e5f\u6ca1\u591a\u5c11\u4fee\u6539\uff0c\u5e72\u8106\u628a\u4ee3\u7801\u63d0\u5230\u4e86 GitHub \u4e0a\uff0c\u4ee5\u540e\u76f4\u63a5\u4ece GitHub \u62c9\u4ee3\u7801\u603b\u4e0d\u4f1a\u51fa\u95ee\u9898\u4e86\u5427\u3002<\/p>\n<p>\u6709\u8da3\u7684\u662f\u5728\u641c\u7d22\u89e3\u51b3\u65b9\u6848\u7684\u65f6\u5019\u53d1\u73b0\u4e86\u4e00\u6bb5\u8bdd:<\/p>\n<blockquote>\n<p>This isn&#8217;t much help but: do not store Git repos in Dropbox or any other sync services. Git isn&#8217;t built to handle another program randomly locking and rewriting files while it&#8217;s doing something else.<\/p>\n<\/blockquote>\n<p>\u4e4b\u524d\u4e5f\u6709\u8fc7\u628a git \u4ed3\u5e93\u653e\u5728 OneDrive \u4e0a\uff0c\u4e0d\u8fc7\u53ea\u662f push\uff0c\u6ca1\u6709\u4ece\u4e0a\u9762 clone \u8fc7\uff0c\u4e5f\u6ca1\u6709\u540c\u6b65\u5230\u591a\u7aef push \u548c clone \u8fc7\uff0c\u73b0\u5728\u770b\u4f3c\u4e4e\u8981\u91cd\u65b0\u8003\u8651\u4e00\u4e0b\u8fd9\u79cd\u65b9\u6848\u7684\u53ef\u884c\u6027\u4e86\u3002\u4e0d\u77e5\u9053\u5927\u5bb6\u6709\u6ca1\u6709\u51fa\u73b0\u8fc7\u7c7b\u4f3c\u7684\u95ee\u9898\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>15<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5653120\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5efa\u8bae\u7528 git bundle \u529f\u80fd\u6253\u5305\u6210\u5355\u6587\u4ef6\u7136\u540e\u4e0a\u4f20\u4e91\u5b58\u50a8                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653121\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nightwitch <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5373\u4f7f\u540c\u6b65\u7b97\u6cd5\u505a\u7684\u6700\u597d(\u4e2a\u4eba\u8ba4\u4e3a)\u7684 dropbox \u4e5f\u7279\u610f\u6307\u51fa\uff0c\u5728\u540c\u6b65\u76d8\u91cc\u653e git \u4ed3\u5e93\u53ef\u80fd\u5bfc\u81f4\u6587\u4ef6\u635f\u574f\u3002dropbox \u7684\u89e3\u51b3\u65b9\u6848\u662f\u7528\u4e00\u4e2a\u4e2d\u95f4\u4ef6 git-remote-dropbox \u6765\u94fe\u63a5 git \u548c dropbox \u3002<br \/> <img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2021\/04\/20210419_607cd06e6a16f.png\" rel=\"noreferrer\" alt=\"git \u4ed3\u5e93\u540c\u6b65\u5230\u575a\u679c\u4e91\u4e0a\u540e\u635f\u574f\u4e86\"> <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653122\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : EscYezi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @codehz #1 \u5b66\u5230\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653123\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dingwen07 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/blog.jianguoyun.com\/?p=2839                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653124\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : omph <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5177\u4f53\u662f\u54ea\u91cc\u4e0d\u517c\u5bb9\u7684\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653125\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nieyujiang <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6240\u4ee5\u4e3a\u4ec0\u4e48\u4e0d\u76f4\u63a5\u4e00\u5f00\u59cb\u5c31\u7528 github \u4e4b\u7c7b\u7684\u4e1c\u897f\u5462.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653126\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : EscYezi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @nieyujiang #6 \u516c\u53f8\u7f51\u7edc\u8bbf\u95ee GitHub \u4e0d\u592a\u7a33\u5b9a\uff0cgitee \u7528\u6765\u505a GitHub \u7684\u56fd\u5185\u955c\u50cf\uff0c\u5176\u4ed6\u5e73\u53f0\u6682\u4e0d\u8003\u8651\u3002\u5982\u679c GitHub \u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u4e00\u5f00\u59cb\u5c31\u4e0d\u4f1a\u8003\u8651\u8fd9\u4e2a\u65b9\u6848\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653127\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : gxy2825 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bd5\u8bd5 Coding                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653128\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : secretman <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e91\u5b58\u50a8\u4e00\u822c\u4e0d\u80fd\u5b58 git \u9879\u76ee\u554a\uff0c\u5947\u5947\u602a\u602a\u7684\u95ee\u9898\u8001\u591a\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653129\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : secretman <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5f53\u4f60\u6709\u591a\u4e2a\u5206\u652f\u4e0d\u65ad\u6765\u56de\u5207\u6362\u65f6\uff0c\u5927\u91cf\u6587\u4ef6\u4e0d\u4e00\u81f4\u65f6\uff0c\u4f60\u4f1a\u53d1\u73b0\u4e91\u540c\u6b65\u5927\u6982\u7387\u5c31\u5361\u6b7b\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653130\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : guochao <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             git \u4f1a\u5feb\u901f\u64cd\u4f5c\u5927\u91cf\u6587\u4ef6\uff0c\u5e76\u4e14\u6d89\u53ca\u5230 filemode \u4e00\u7c7b\u7684\u6587\u4ef6\u5c5e\u6027\u7684\u64cd\u4f5c\uff0c\u540c\u6b65\u76d8\u672c\u8d28\u662f\u628a\u6587\u4ef6\u5185\u5bb9\u4fee\u6539\u6392\u961f\u4e0a\u4f20\uff0c\u5b9a\u671f squash\uff0c\u6709\u610f\u5916\u60c5\u51b5\u7684\u65f6\u5019\uff08\u6bd4\u5982\u8bf4\u5728\u5f88\u77ed\u65f6\u95f4\u5185\u589e\u51cf\u540c\u4e00\u4e2a\u8def\u5f84\u4e0a\u7684\u6587\u4ef6\uff09\u5f88\u5bb9\u6613\u7834\u574f git \u6811\uff0c\u800c\u4e14\u65e0\u6cd5\u4fdd\u7559 filemode \u4e5f\u4f1a\u4e22\u5931\u975e\u5e38\u591a\u4fe1\u606f\u3002\u7c7b\u4f3c\u7684\u662f vim\uff0c\u4e5f\u4f1a\u5feb\u901f\u7684\u589e\u5220\u6587\u4ef6<\/p>\n<p>\u76f4\u63a5\u63d0\u4ea4\u5230 git{hub,lab,ee}\u5427\uff0cgitlab \u5728\u56fd\u5185\u4e5f\u5efa\u4e86\u56e2\u961f\uff0cgitee \u548c gitlab \u5728\u56fd\u5185\u7684\u53ef\u7528\u6027\u5e94\u8be5\u90fd\u4f1a\u76f8\u5bf9\u8d8a\u6765\u8d8a\u597d                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653131\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : fengjianxinghun <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @guochao github \u4e0d\u53ef\u80fd\u597d\uff0cgitlab \u56fd\u533a\u7279\u4f9b\u624d\u53ef\u80fd\u597d\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653132\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : FrankHB <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u516c\u53f8\u7a77\u5230\u8fde\u81ea\u5efa GitLab \u5b9e\u4f8b\u90fd\u8d1f\u62c5\u4e0d\u8d77\u7684\u8bdd\u76f4\u63a5 Gitee \u5427\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653133\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : EscYezi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @FrankHB \u5012\u4e0d\u662f\u516c\u53f8\u6ca1\u6709\u81ea\u5efa\u4ed3\u5e93\uff0c\u81ea\u5df1\u7684\u4e00\u4e9b\u4e1c\u897f\u6ca1\u6cd5\u4f20\u5230\u516c\u53f8\u4ed3\u5e93\u91cc                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5653134\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tomkliyes <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @EscYezi \u81ea\u5df1\u5728 gitee \u4e0a\u5efa\u4e2a\u79c1\u6709\u4ed3\u5e93\u5427\u2026\u2026\u4eba\u751f\u82e6\u77ed\uff0c\u4e0d\u8981\u82b1\u592a\u591a\u65f6\u95f4\u5728\u8fd9\u79cd\u4e8b\u60c5\u4e0a\u9762\u2026\u2026\u5f53\u7136\u5982\u679c\u4f60\u672c\u8eab\u5c31\u662f\u505a\u4e91\u5b58\u50a8\u76f8\u5173\u7684\u5de5\u4f5c\u5c31\u5f53\u6211\u6ca1\u8bf4                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>git \u4ed3\u5e93\u540c\u6b65\u5230\u575a\u679c\u4e91\u4e0a\u540e\u635f\u574f\u4e86&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\/432790"}],"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=432790"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/432790\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=432790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=432790"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=432790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}