{"id":1144,"date":"2011-12-12T10:52:00","date_gmt":"2011-12-12T02:52:00","guid":{"rendered":"\/?p=1144"},"modified":"2011-12-12T10:52:00","modified_gmt":"2011-12-12T10:52:00","slug":"1144","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/other\/1144.html","title":{"rendered":"\u3010\u539f\u521b\u7ffb\u8bd1\u3011GIT\u521d\u59cb\u5316–bare\u53c2\u6570\uff1agit init & git init –bare"},"content":{"rendered":"
\u5728\u4f7f\u7528Git\u521d\u59cb\u5316\u7248\u672c\u5e93\u7684\u65f6\u5019\uff0c\u4f7f\u7528"git init"\u547d\u4ee4\u548c\u4f7f\u7528"git init –bare"\u547d\u4ee4\u6709\u4ec0\u4e48\u533a\u522b\u5462\uff1f<\/p>\n
\u7528"git init"\u521d\u59cb\u5316\u7684\u7248\u672c\u5e93\uff08\u6682\u4e14\u79f0\u4e4b\u4e3aworking repository<\/b>\uff09\u5c06\u4f1a\u751f\u62102\u7c7b\u6587\u4ef6\uff1a\u201c.git\u201c\u7248\u672c\u5e93\u76ee\u5f55(\u8bb0\u5f55\u7248\u672c\u5386\u53f2)\u548c\u5b9e\u9645\u9879\u76ee\u6587\u4ef6\u7684\u62f7\u8d1d\u3002\u4f60\u53ef\u4ee5\u628a\u8fd9\u7c7b\u7248\u672c\u5e93\u53eb\u505a\u201c\u5de5\u4f5c\u76ee\u5f55\u201d\u3002\u5de5\u4f5c\u76ee\u5f55\u662f\u4e00\u4e2a\u5305\u542b\u6709\u7248\u672c\u5386\u53f2\u76ee\u5f55\u201c.git"\u548c\u6e90\u6587\u4ef6\u7684\u76ee\u5f55\u3002\u4f60\u53ef\u4ee5\u5728\u5de5\u4f5c\u76ee\u5f55\u4fee\u6539\u4f60\u7684\u6e90\u6587\u4ef6\u5e76\u4f7f\u7528"git add"\u548c"git commit"\u547d\u4ee4\u8fdb\u884c\u7248\u672c\u7ba1\u7406\u3002<\/p>\n
\u7528\u201cgit init –bare"\u521d\u59cb\u5316\u7684\u7248\u672c\u5e93\uff08\u6682\u4e14\u79f0\u4e4b\u4e3abare repository<\/b>\uff09\u4ec5\u5305\u542b".git"\u76ee\u5f55\uff08\u8bb0\u5f55\u7248\u672c\u5386\u53f2\uff09\uff0c\u4e0d\u542b\u9879\u76ee\u6e90\u6587\u4ef6\u62f7\u8d1d\u3002\u5982\u679c\u4f60\u8fdb\u5165\u7248\u672c\u76ee\u5f55\uff0c\u4f60\u4f1a\u53d1\u73b0\u4ec5\u6709".git"\u76ee\u5f55\uff0c\u6ca1\u6709\u5176\u4ed6\u6587\u4ef6\u3002\u7248\u672c\u5e93\u4ec5\u5305\u542b\u8bb0\u5f55\u7740\u7248\u672c\u5386\u53f2\u7684\u6587\u4ef6\u3002<\/p>\n
\u4ec0\u4e48\u60c5\u51b5\u4e0b\u4f7f\u7528\u201cgit init"\u548c"git init –bare"\u5462\uff1f<\/p>\n
working repository\u9002\u5408\u4e8e\u5b9e\u9645\u7f16\u8f91\u751f\u4ea7\u8fc7\u7a0b\u4e2d\uff0c\u5728\u5de5\u4f5c\u76ee\u5f55\u4e0b\uff0c\u4f60\u5c06\u4f1a\u8fdb\u884c\u5b9e\u9645\u7684\u7f16\u7801\u3001\u6587\u4ef6\u7ba1\u7406\u64cd\u4f5c\u548c\u4fdd\u5b58\u9879\u76ee\u5728\u672c\u5730\u5de5\u4f5c\u3002\u5982\u679c\u4f60\u5f00\u59cb\u521b\u5efa\u4e00\u4e2a\u9879\u76ee\u5c06\u5305\u542b\u6709\u6e90\u4ee3\u7801\u548c\u548c\u7248\u672c\u8ddf\u8e2a\u8bb0\u5f55\u7684\u65f6\u5019\u4f60\u53ef\u4ee5\u4f7f\u7528"git init".\u6216\u8005\uff0c\u5982\u679c\u4f60\u514b\u9686"git clone"\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684\u7248\u672c\u5e93\u7684\u65f6\u5019\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2aworking repository\uff0c\u5b83\u4e5f\u5c06\u5305\u542b".git"\u76ee\u5f55\u548c\u6e90\u6587\u4ef6\u7684\u62f7\u8d1d\u3002<\/p>\n
bare repository\u4e3b\u8981\u662f\u7528\u4f5c\u5206\u4eab\u7248\u672c\u5e93\u3002\u5f00\u53d1\u8005\u4f7f\u7528bare repository\u53ef\u4ee5\u5411\u5176\u4ed6\u4eba\u5206\u4eab\u5b58\u50a8\u5728\u672c\u5730\u7684\u7248\u672c\u5e93\uff0c\u4ee5\u4fbf\u4e8e\u5b9e\u65f6\u5206\u4eab\u4ee3\u7801\u66f4\u65b0\u548c\u56e2\u961f\u534f\u4f5c \u3002\u901a\u8fc7\u4f7f\u7528"git push"\u547d\u4ee4\uff0c\u4f60\u53ef\u4ee5\u5c06\u4f60\u7684\u672c\u5730\u66f4\u65b0\u63d0\u4ea4\u81f3\u201c\u4e2d\u5fc3\u7248\u672c\u5e93\u201d\uff08\u5176\u4ed6\u5f00\u53d1\u8005\u53ef\u8bbf\u95ee\u7684\u4e2d\u5fc3\u5e93\uff09\u3002\u5176\u4ed6\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528\u201cgit pull"\u547d\u4ee4\u8005\u63a5\u53d7\u4f60\u63d0\u4ea4\u7684\u7248\u672c\u66f4\u65b0\u3002\u5982\u679c\u4f60\u6b63\u5728\u4e00\u4e2a\u591a\u4eba\u534f\u4f5c\u7684\u9879\u76ee\u56e2\u961f\u6216\u8005\u540c\u4e00\u4e2a\u9879\u76ee\u9700\u8981\u5728\u4e0d\u540c\u7535\u8111\u4e0a\u9762\u5b8c\u6210\u7684\u65f6\u5019\uff0cbare repository\u53ef\u4ee5\u6ee1\u8db3\u4f60\u7684\u5206\u5e03\u5f0f\u5f00\u53d1\u9700\u6c42\u3002<\/p>\n
\u603b\u7ed3\uff1a<\/b>\u201c\u5de5\u4f5c\u76ee\u5f55\u201d\u662f\u901a\u8fc7\u4f7f\u7528\u201cgit init\u201c\u6216\u201cgit clone\u201d\u521b\u5efa\u7684\u672c\u5730\u9879\u76ee\u62f7\u8d1d\u3002\u6211\u4eec\u53ef\u4ee5\u5728\u5de5\u4f5c\u76ee\u5f55\u4e0b\u9762\u4fee\u6539\u548c\u6d4b\u8bd5\u4ee3\u7801\u3002\u901a\u8fc7\u6d4b\u8bd5\u540e\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u201cgit add\u201c\u548c\u201dgit commit\u201c\u547d\u4ee4\u672c\u5730\u63d0\u4ea4\u4fee\u6539\uff0c\u7136\u540e\u4f7f\u7528\u201cgit push\u201d\u547d\u4ee4\u5411\u8fdc\u7a0b bare repository\u5e93\u63d0\u4ea4\u66f4\u65b0\uff0c\u901a\u5e38bare repository\u6307\u5b9a\u5176\u4ed6\u670d\u52a1\u5668\uff0c\u5176\u4ed6\u5f00\u53d1\u8005\u5c06\u53ef\u4ee5\u53ca\u65f6\u770b\u5230\u4f60\u7684\u66f4\u65b0\u3002\u5f53\u6211\u4eec\u60f3\u53bb\u66f4\u65b0\u672c\u5730\u5de5\u4f5c\u76ee\u5f55\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u201cgit pull\u201d\u547d\u4ee4\u53bb\u63a5\u53d7\u5176\u4ed6\u5f00\u53d1\u8005\u63d0\u4ea4\u7684\u66f4\u65b0\u3002<\/p>\n
\u539f\u6587\uff1awhat is a bare git repository?<\/b> http:\/\/www.saintsjd.com\/2011\/01\/what-is-a-bare-git-repository\/<\/a> \u5728\u4f7f\u7528Git\u521d\u59cb\u5316\u7248\u672c\u5e93\u7684\u65f6\u5019\uff0c\u4f7f\u7528"git init"\u547d\u4ee4\u548c\u4f7f\u7528"git init –bare"\u547d\u4ee4\u6709\u4ec0\u4e48\u533a\u522b\u5462\uff1f<\/p>\n \u7528"git init"\u521d\u59cb\u5316\u7684\u7248\u672c\u5e93\uff08\u6682\u4e14\u79f0\u4e4b\u4e3aworking repository<\/b>\uff09\u5c06\u4f1a\u751f\u62102\u7c7b\u6587\u4ef6\uff1a\u201c.git\u201c\u7248\u672c\u5e93\u76ee\u5f55(\u8bb0\u5f55\u7248\u672c\u5386\u53f2)\u548c\u5b9e\u9645\u9879\u76ee\u6587\u4ef6\u7684\u62f7\u8d1d\u3002\u4f60\u53ef\u4ee5\u628a\u8fd9\u7c7b\u7248\u672c\u5e93\u53eb\u505a\u201c\u5de5\u4f5c\u76ee\u5f55\u201d\u3002\u5de5\u4f5c\u76ee\u5f55\u662f\u4e00\u4e2a\u5305\u542b\u6709\u7248\u672c\u5386\u53f2\u76ee\u5f55\u201c.git"\u548c\u6e90\u6587\u4ef6\u7684\u76ee\u5f55\u3002\u4f60\u53ef\u4ee5\u5728\u5de5\u4f5c\u76ee\u5f55\u4fee\u6539\u4f60\u7684\u6e90\u6587\u4ef6\u5e76\u4f7f\u7528<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1144"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1144"}],"version-history":[{"count":0,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1144\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\u8bd1By: \u76f4\u6765\u76f4\u5f80<\/b> http:\/\/hi.baidu.com\/aboutstudy\/blog\/item\/8cec7226e3c101098a82a1c6.html<\/a><\/p><\/p>\n","protected":false},"excerpt":{"rendered":"