{"id":442,"date":"2019-12-14T10:56:38","date_gmt":"2019-12-14T02:56:38","guid":{"rendered":"https:\/\/www.caiqinyi.cn\/?p=442"},"modified":"2025-02-09T11:18:09","modified_gmt":"2025-02-09T03:18:09","slug":"git_repo","status":"publish","type":"post","link":"https:\/\/www.caiqinyi.cn\/index.php\/2019\/12\/14\/git_repo\/","title":{"rendered":"\u5728\u670d\u52a1\u5668\u4e0a\u642d\u5efagit\u4ed3\u5e93"},"content":{"rendered":"<p>\u6628\u5929\u5728git\u670d\u52a1\u5668\u4e0a\u7b2c\u4e00\u6b21\u521b\u5efa\u4e86\u81ea\u5df1\u7684\u4ed3\u5e93, \u7528\u6765\u505a-1\u4efb\u52a1\u4ee3\u7801\u7684\u7ba1\u7406. \u7279\u6b64\u8bb0\u5f55\u4e0b~<\/p>\n<p><!--more--><\/p>\n<p>\u9996\u5148, \u6211\u5df2\u7ecf\u521b\u5efa\u4e86git\u8d26\u6237, \u6240\u4ee5\u8fd9\u90e8\u5206\u5c31\u5148\u8df3\u8fc7\u4e0d\u8bb2\u4e86. \u63a5\u4e0b\u6765\u521b\u5efa\u4e00\u4e2a\u7528\u6765\u653e\u7f6e\u4ed3\u5e93\u7684\u6587\u4ef6\u5939,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\ncd \/home\/git\/repo\r\nsudo mkdir PyMacroParser\r\n<\/pre>\n<p>\u7136\u540e\u53ef\u4ee5\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u521b\u5efa\u65b0\u5efa\u7684\u9879\u76ee(\u6b64\u5904\u540d\u5b57\u53ebPyMacroParser) \u5730\u5740,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\ncd PyMacroParser\r\nsudo mkdir -p PyMacroParser.git\r\n<\/pre>\n<p>\u63a5\u4e0b\u6765\u628a\u9879\u76ee\u8fdb\u884c\u521d\u59cb\u5316,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\nsudo git init --bare PyMacroParser.git\r\n<\/pre>\n<p>\u521b\u5efa\u5b8c\u6210\u4ee5\u540e\u770b\u4e00\u4e0b\u6587\u4ef6\u5939\u6743\u9650,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\nll\r\ntotal 12\r\ndrwxr-xr-x 3 git git 4096 Dec 13 14:21 .\/\r\ndrwxr-xr-x 4 git git 4096 Dec 13 14:21 ..\/\r\ndrwxr-xr-x 7 git git 4096 Dec 13 14:22 PyMacroParser.git\/\r\n<\/pre>\n<p>\u53ef\u4ee5\u770b\u5230PyMacroParser.git\u7684\u6240\u5c5e\u7528\u6237\u5df2\u7ecf\u662fgit\u4e86, \u9ed8\u8ba4\u662f\u5c5e\u4e8eroot\u7528\u6237\u7684, \u5982\u679c\u662f\u9171\u7d2b, \u9700\u8981\u66f4\u6539\u5176\u6240\u5c5e\u7528\u6237,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\nsudo chown -R git:git PyMacroParser.git\/\r\n<\/pre>\n<p>\u540c\u6837\u5730, \u9700\u8981\u66f4\u6539\u5916\u9762\u4e00\u5c42\u6587\u4ef6\u5939PyMacroParser\u7684\u6240\u5c5e\u7528\u6237. (\u867d\u7136\u4e0d\u6e05\u695a\u6ca1\u6709\u6539\u7684\u8bdd\u4f1a\u600e\u6837\u2026\u2026 \u4f46\u6700\u597d\u8fd8\u662f\u4fdd\u6301\u6240\u5c5e\u7528\u6237\u4e00\u81f4, \u4ee5\u9632\u51fa\u73b0\u4ec0\u4e48\u83ab\u540d\u5176\u5999\u7684\u9519\u8bef)<\/p>\n<p>\u5728\u670d\u52a1\u5668\u4e0a\u505a\u5b8c\u4e0a\u8ff0\u64cd\u4f5c\u4ee5\u540e, \u5c31\u53ef\u4ee5\u4f7f\u7528\u5e38\u89c4\u7684git clone\u547d\u4ee4\u8fdb\u884c\u5bf9\u4ed3\u5e93\u7684\u5404\u79cd\u64cd\u4f5c\u4e86. \u7136\u800c\u5728git push\u64cd\u4f5c\u65f6\u4f1a\u63d0\u793a<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\n'orgin' does not appear to be a git repository\r\n<\/pre>\n<p>\u6b64\u65f6\u5219\u9700\u8981\u5728\u672c\u5730\u91cd\u65b0\u751f\u6210origin\u5373\u53ef,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\ngit remote rm origin\r\ngit remote add origin git@www.caiqinyi.cn:\/home\/git\/repo\/PyMacroParser\/PyMacroParser.git\r\n<\/pre>\n<p>\u6700\u540e\u518d\u89e3\u51b3Sourcetree\u63d0\u4ea4\u4ee3\u7801\u65f6\u51fa\u73b0\u7684\u9519\u8bef,<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"C++\" data-enlighter-theme=\"monokai\">\r\nfatal: Could not read from remote repository.\r\n\r\nPlease make sure you have the correct access rights\r\nand the repository exists.\r\n<\/pre>\n<p>\u5728Sourcetree\u4e2d\u66f4\u6539\u5982\u4e0b\u8bbe\u7f6e\u5373\u53ef,<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2019\/12\/Sourcetree_SSH.png\" alt=\"\" width=\"1362\" height=\"1200\" class=\"alignnone size-full wp-image-445\" srcset=\"https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2019\/12\/Sourcetree_SSH.png 1362w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2019\/12\/Sourcetree_SSH-300x264.png 300w, https:\/\/www.caiqinyi.cn\/wp-content\/uploads\/2019\/12\/Sourcetree_SSH-768x677.png 768w\" sizes=\"(max-width: 1362px) 100vw, 1362px\" \/><\/p>\n<p>\u65b0\u7248\u672c\u7684SSH\u5ba2\u6237\u7aef\u9009\u9879\u9ed8\u8ba4\u4e3aPuTTY\/Plink, \u628a\u5b83\u6362\u6210OpenSSH\u5c31\u53ef\u4ee5\u4e86, \u5b83\u4f1a\u9ed8\u8ba4\u4f7f\u7528git\u7684SSH\u5bc6\u94a5, \u8fd9\u65f6\u5019Sourcetree\u5c31\u6062\u590d\u6b63\u5e38\u5566~<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6628\u5929\u5728git\u670d\u52a1\u5668\u4e0a\u7b2c\u4e00\u6b21\u521b\u5efa\u4e86\u81ea\u5df1\u7684\u4ed3\u5e93, \u7528\u6765\u505a-1\u4efb\u52a1\u4ee3\u7801\u7684\u7ba1\u7406. \u7279\u6b64\u8bb0\u5f55\u4e0b~<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/posts\/442"}],"collection":[{"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/comments?post=442"}],"version-history":[{"count":8,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/posts\/442\/revisions"}],"predecessor-version":[{"id":3554,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/posts\/442\/revisions\/3554"}],"wp:attachment":[{"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/media?parent=442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/categories?post=442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.caiqinyi.cn\/index.php\/wp-json\/wp\/v2\/tags?post=442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}