{"id":362,"date":"2022-05-18T15:19:20","date_gmt":"2022-05-18T07:19:20","guid":{"rendered":"http:\/\/madapapa.com\/wordpress\/?p=362"},"modified":"2022-05-18T23:51:51","modified_gmt":"2022-05-18T15:51:51","slug":"jie-juegit-wu-fapush-de-wen-ti","status":"publish","type":"post","link":"http:\/\/madapapa.com\/wordpress\/?p=362","title":{"rendered":"\u89e3\u51b3git\u65e0\u6cd5push\u7684\u95ee\u9898"},"content":{"rendered":"<h2><a id=\"%E8%83%8C%E6%99%AF\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u80cc\u666f<\/h2>\n<p>5\u670816\u65e5\uff0c\u4e5f\u5c31\u662f\u524d\u5929\uff0c\u6211\u5f00\u59cb\u5b66\u4e60\u674e\u8f89\u7684<a href=\"https:\/\/read.helloflask.com\/c4-static\">Flask\u5165\u95e8\u6559\u7a0b<\/a>\u3002<\/p>\n<p>\u76ee\u7684\u5f88\u7b80\u5355\uff0c\u7531\u4e8e\u82b1\u4e86\u4e00\u5468\u65f6\u95f4\u5b66\u4e60Miguel Grinberg\u7684<a href=\"https:\/\/blog.miguelgrinberg.com\/post\/the-flask-mega-tutorial-part-iv-database\">The Flask Mega-Tutorial<\/a>\uff0c\u5728\u7b2c\u56db\u7ae0\u201cDatabase\u201d\u4e0a\u7684\u65f6\u95f4\u6709\u5c06\u8fd13\u5929\u3002\u6211\u611f\u89c9\u81ea\u5df1\u7684\u8fdb\u5ea6\u6709\u4e9b\u5feb\uff0c\u6b65\u5b50\u592a\u5927\uff0c\u7ec8\u4e8e\u626f\u5230\u4e86\u3002<\/p>\n<p>\u6309\u7167\u63a8\u7279\u4e0a\u8fd9\u4f4d\u5927\u795e\u7684\u8bf4\u6cd5\uff0c\u8981\u4eab\u53d7\u6d77\u6d0b\u822c\u7684\u7801\u519c\u7684\u5de5\u4f5c\u673a\u4f1a\uff0c\u8981\u7ecf\u53869\u5c42\u78e8\u96be\uff1aFlask\u662f\u7b2c7\u5c42\uff0cDatabase\u662f\u7b2c8\u5c42\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/madapapa.com\/wordpress\/wp-content\/uploads\/2022\/05\/wecom-temp-90ebe03d8c5e0ab68eda5686bd5102e9.jpg\" alt=\"wecom-temp-90ebe03d8c5e0ab68eda5686bd5102e9\" \/><\/p>\n<p>\u5728\u7b2c8\u5c42\u6ede\u7559\u8bb8\u4e45\u540e\uff0c\u6211\u5f00\u59cb\u91c7\u7528\u674e\u8f89\u7684\u6559\u7a0b\uff0c\u8fd9\u4e2a\u6559\u7a0b\u6070\u597d\u4e0eMiguel Grinberg\u7684\u6559\u6750\u5728\u90e8\u5206\u77e5\u8bc6\u70b9\u4e0a\u4e92\u8865\u3002\u6bd4\u5982\u3010Mega-Tutorial\u3011\u4ecb\u7ecd\u4f7f\u7528git\u65f6\uff0c\u4ec5\u4ec5\u4ecb\u7ecd\u4e86git clone\u547d\u4ee4\uff0c\u65b9\u4fbf\u8bfb\u8005\u4e0d\u7528\u9010\u884c\u6572\u4ee3\u7801\uff0c\u800c\u3010Flask\u5165\u95e8\u6559\u7a0b\u3011\u5bf9git\u7684\u4ecb\u7ecd\u5c31\u66f4\u5b9e\u7528\uff0c\u4ecegit repo\u7684\u5efa\u7acb\u5f00\u59cb\uff0c\u5305\u62ec\u5982\u4f55\u7ba1\u7406\u81ea\u5df1\u7684git hub\u9875\u9762\u3002<\/p>\n<p>\u4f7f\u7528git\u5b8c\u6210watchlist\u9879\u76ee\u540e\uff0c\u4f9d\u846b\u82a6\u753b\u74e2\uff0c\u6211\u5728microblog\u7684\u9879\u76ee\u4e0a\u4e5f\u4f7f\u7528\u4e86\u7c7b\u4f3c\u547d\u4ee4\uff0c\u4f46\u662f\u95ee\u9898\u5c31\u53d1\u751f\u4e86\uff1a<\/p>\n<pre><code class=\"language-plain_text\">22-05-18\/Users\/xxxxx\/study\/test~%&gt;git branch -a\n*flask\nmaster\n<\/code><\/pre>\n<p>\u4f3c\u4e4e\u81ea\u5df1\u5c31\u88ab\u56f0\u5728\u4e86\u3010Mega-Tutroial\u3011\u7684\u602a\u5708\u91cc\uff0c\u6211\u4f30\u8ba1\u539f\u56e0\u662f\u4f7f\u7528git clone\u540e\uff0c\u9ed8\u8ba4\u7684\u5206\u652f\u5c31\u662fflask\uff0c\u800c\u4e0d\u662f\u81ea\u5df1\u65b0\u5efa\u7684master\u5206\u652f\uff0c\u800c\u4e14\u65e0\u6cd5\u5220\u9664flask\u8fd9\u4e2a\u4e3b\u5206\u652f\u3002<\/p>\n<p>\u6700\u76f4\u63a5\u7684\u529e\u6cd5\uff0c\u662f\u65b0\u5efa\u4e86\u4e00\u4e2atest\u76ee\u5f55\uff0c\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u628a\u6240\u6709\u6587\u4ef6\u62f7\u8d1d\u5230flasktest\u4e0b\u9762\uff0c\u5bf9\u539f\u6765\u7684\u5185\u5bb9\u8986\u76d6\u6389\u3002<\/p>\n<pre><code class=\"language-plain_text\">cp -rf flasktest\/. test\n<\/code><\/pre>\n<p>\u7136\u800c\uff0c\u9664\u4e86\u4e3bbranch\u53d8\u6210master\u5916\uff0c\u4e00\u5207\u7167\u65e7\u3002<\/p>\n<h2><a id=\"%E9%97%AE%E9%A2%98%E7%8E%B0%E8%B1%A1%E4%B8%8E%E5%88%86%E6%9E%90\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u95ee\u9898\u73b0\u8c61\u4e0e\u5206\u6790<\/h2>\n<h3><a id=\"%E7%8E%B0%E8%B1%A1\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u73b0\u8c61<\/h3>\n<p>\u6211\u5f00\u59cb\u5c31\u8ba4\u4e3a\u662f\u6743\u9650\u95ee\u9898\uff0c\u201caccess rights\u201d\u3002<\/p>\n<pre><code class=\"language-plain_text\">22-05-18\/Users\/XXXXX\/study\/flasktest~%&gt;git pull\nERROR: Repository not found.\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n<\/code><\/pre>\n<p>\u6240\u4ee5\u628a\u52aa\u529b\u65b9\u5411\u653e\u5728\u5982\u4f55\u4f18\u5316\u6388\u6743\u4e0a\u9762\uff0c\u6bd4\u5982\u628a\u79c1\u94a5\u518d\u589e\u52a0\u4e00\u6b21\uff1a<\/p>\n<pre><code class=\"language-plain_text\">ssh-add ~\/.ssh\/id_rsa\n<\/code><\/pre>\n<pre><code class=\"language-plain_text\">22-05-18\/Users\/XXXXX\/study\/flasktest~%&gt;ssh-add -l\n3072 SHA256:n9EHVCpvMuEfdkajdfkajfdkjakdfjakjdfak\/\/Q5pbok XXXXXXXX@dfjakjdfjdfajdfa (RSA)\n<\/code><\/pre>\n<h3><a id=\"%E5%88%86%E6%9E%90\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u5206\u6790<\/h3>\n<p>\u7531\u4e8e\u544a\u8b66\u4fe1\u606f\u4e2d\u4e5f\u51fa\u73b0\u4e86\u201cno work tree\u201d\uff0c\u7f51\u4e0a\u6709\u7c7b\u4f3c\u5206\u6790\u8bf4\u8fd9\u662fbare repository\uff1a<br \/>\n<strong>The direct reason for the error is that yes, it&#8217;s impossible to use git-add with a bare repository. A bare repository, by definition, has no work tree. git-add takes files from the work tree and adds them to the index, in preparation for committing.<\/strong><br \/>\n\u5c1d\u8bd5\u53bb\u9664bare\uff1a<\/p>\n<pre><code class=\"language-plain_text\">git config --unset core.bare\n<\/code><\/pre>\n<p>\u4e5f\u6709\u610f\u89c1\u8bf4\uff0c\u5728git\u7684\u914d\u7f6e\u6587\u4ef6\u91cc\uff0c\u628aorigin\u76f8\u5173\u4fe1\u606f\u90fd\u5c4f\u853d\u6389\uff1a<\/p>\n<pre><code class=\"language-plain_text\">22-05-18\/Users\/xxxxxxxxx\/study\/test\/.git~%&gt;vi config\n[core]\n        repositoryformatversion = 0\n        filemode = true\n        bare = false\n        logallrefupdates = true\n        ignorecase = true\n        precomposeunicode = true\n#[remote &quot;origin&quot;]\n#       url = git@github.com:xxxxxxxx\/flasktest.git\n#       fetch = +refs\/heads\/*:refs\/remotes\/origin\/*\n#[remote &quot;origin&quot;]\n#       url = git@github.com:xxxxxxxx\/flasktest.git\n#       fetch = +refs\/heads\/*:refs\/remotes\/origin\/*\n[remote &quot;origin&quot;]\n        url = git@github.com:xxxxxxxxx\/flasktest.git\n        fetch = +refs\/heads\/*:refs\/remotes\/origin\/*\n<\/code><\/pre>\n<h2><a id=\"%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u95ee\u9898\u89e3\u51b3<\/h2>\n<p>\u6298\u817e\u4e862\u5929\uff0c\u6700\u540e\u53ea\u80fd\u76ef\u7740\u5c4f\u5e55\u544a\u8b66\uff0c\u7a81\u7136\u53d1\u73b0\u201cand the repository exists\u201d\uff0c\u8fd9\u53e5\u8bdd\u63d0\u9192\u6211\uff0c\u662f\u4e0d\u662f\u8fd9\u4e2arepo\u6839\u672c\u5c31\u6ca1\u6709\u521b\u5efa\u6210\u529f\u8fc7\uff1f<\/p>\n<p>\u7acb\u5373\u4e0agithub\uff0c\u624b\u52a8\u521b\u5efarepo\u3002<br \/>\n<img decoding=\"async\" src=\"http:\/\/madapapa.com\/wordpress\/wp-content\/uploads\/2022\/05\/16528881981478.jpg\" alt=\"\" \/><br \/>\n\u7136\u540e\u4e00\u5207\u6c34\u5230\u6e20\u6210<\/p>\n<pre><code class=\"language-plain_text\">22-05-18\/Users\/xxxxxx\/study\/flasktest~%&gt;git branch -a\n* master\n  remotes\/origin\/master\n<\/code><\/pre>\n<h2><a id=\"%E5%8F%8D%E6%80%9D\" class=\"anchor\" aria-hidden=\"true\"><span class=\"octicon octicon-link\"><\/span><\/a>\u53cd\u601d<\/h2>\n<ol>\n<li>\u60f3\u5f53\u7136\u8ba4\u4e3a\uff0crepo\u662f\u901a\u8fc7git\u547d\u4ee4\u884c\u6765\u5efa\u7acb\u7684\uff0c\u56e0\u6b64\u4e0d\u65ad\u7684\u5047\u8bbeflasktest.git\u5df2\u7ecf\u5efa\u7acb\u597d\u4e86\uff1b<\/li>\n<li>\u5e76\u6ca1\u6709\u8ba4\u771f\u5bf9\u5f85git\uff0cgit\u7684\u57f9\u8bad\u6559\u7a0b\u4e5f\u6ca1\u6709\u8ba4\u771f\u5b66\u4e60\u3002<\/li>\n<\/ol>\n<p><a href=\"https:\/\/lab.github.com\/githubtraining\/introduction-to-github\">git\u57f9\u8bad\u6559\u6750<\/a><br \/>\n<img decoding=\"async\" src=\"http:\/\/madapapa.com\/wordpress\/wp-content\/uploads\/2022\/05\/16528890977617.jpg\" alt=\"\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f 5\u670816\u65e5\uff0c\u4e5f\u5c31\u662f\u524d\u5929\uff0c\u6211\u5f00\u59cb\u5b66\u4e60\u674e\u8f89\u7684Flask\u5165\u95e8\u6559\u7a0b\u3002 \u76ee\u7684\u5f88\u7b80\u5355\uff0c\u7531\u4e8e\u82b1\u4e86\u4e00\u5468\u65f6\u95f4\u5b66\u4e60Miguel Grinberg\u7684The Flask Mega-Tutorial\uff0c\u5728\u7b2c\u56db\u7ae0\u201cDatabase\u201d\u4e0a\u7684\u65f6\u95f4\u6709\u5c06\u8fd13\u5929\u3002\u6211\u611f\u89c9\u81ea\u5df1\u7684\u8fdb\u5ea6\u6709\u4e9b\u5feb\uff0c\u6b65\u5b50\u592a\u5927\uff0c\u7ec8\u4e8e\u626f\u5230\u4e86\u3002 \u6309\u7167\u63a8\u7279\u4e0a\u8fd9\u4f4d\u5927\u795e\u7684\u8bf4\u6cd5\uff0c\u8981\u4eab\u53d7\u6d77\u6d0b\u822c\u7684\u7801\u519c\u7684\u5de5\u4f5c\u673a\u4f1a\uff0c\u8981\u7ecf\u53869\u5c42\u78e8\u96be\uff1aFlask\u662f\u7b2c7\u5c42\uff0cDatabase\u662f\u7b2c8\u5c42\u3002 \u5728\u7b2c8\u5c42\u6ede\u7559\u8bb8\u4e45\u540e\uff0c\u6211\u5f00\u59cb\u91c7\u7528\u674e\u8f89\u7684\u6559\u7a0b\uff0c\u8fd9\u4e2a\u6559\u7a0b\u6070\u597d\u4e0eMiguel Grinberg\u7684\u6559\u6750\u5728\u90e8\u5206\u77e5\u8bc6\u70b9\u4e0a\u4e92\u8865\u3002\u6bd4\u5982\u3010Mega-Tutorial\u3011\u4ecb\u7ecd\u4f7f\u7528git\u65f6\uff0c\u4ec5\u4ec5\u4ecb\u7ecd\u4e86git clone\u547d\u4ee4\uff0c\u65b9\u4fbf\u8bfb\u8005\u4e0d\u7528\u9010\u884c\u6572\u4ee3\u7801\uff0c\u800c\u3010Flask\u5165\u95e8\u6559\u7a0b\u3011\u5bf9git\u7684\u4ecb\u7ecd\u5c31\u66f4\u5b9e\u7528\uff0c\u4ecegit repo\u7684\u5efa\u7acb\u5f00\u59cb\uff0c\u5305\u62ec\u5982\u4f55\u7ba1\u7406\u81ea\u5df1\u7684git hub\u9875\u9762\u3002 \u4f7f\u7528git\u5b8c\u6210watchlist\u9879\u76ee\u540e\uff0c\u4f9d\u846b\u82a6\u753b\u74e2\uff0c\u6211\u5728microblog\u7684\u9879\u76ee\u4e0a\u4e5f\u4f7f\u7528\u4e86\u7c7b\u4f3c\u547d\u4ee4\uff0c\u4f46\u662f\u95ee\u9898\u5c31\u53d1\u751f\u4e86\uff1a 22-05-18\/Users\/xxxxx\/study\/test~%&gt;git branch -a *flask master \u4f3c\u4e4e\u81ea\u5df1\u5c31\u88ab\u56f0\u5728\u4e86\u3010Mega-Tutroial\u3011\u7684\u602a\u5708\u91cc\uff0c\u6211\u4f30\u8ba1\u539f\u56e0\u662f\u4f7f\u7528git clone\u540e\uff0c\u9ed8\u8ba4\u7684\u5206\u652f\u5c31\u662fflask\uff0c\u800c\u4e0d\u662f\u81ea\u5df1\u65b0\u5efa\u7684master\u5206\u652f\uff0c\u800c\u4e14\u65e0\u6cd5\u5220\u9664flask\u8fd9\u4e2a\u4e3b\u5206\u652f\u3002 \u6700\u76f4\u63a5\u7684\u529e\u6cd5\uff0c\u662f\u65b0\u5efa\u4e86\u4e00\u4e2atest\u76ee\u5f55\uff0c\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u628a\u6240\u6709\u6587\u4ef6\u62f7\u8d1d\u5230flasktest\u4e0b\u9762\uff0c\u5bf9\u539f\u6765\u7684\u5185\u5bb9\u8986\u76d6\u6389\u3002 cp -rf flasktest\/. test \u7136\u800c\uff0c\u9664\u4e86\u4e3bbranch\u53d8\u6210master\u5916\uff0c\u4e00\u5207\u7167\u65e7\u3002 \u95ee\u9898\u73b0\u8c61\u4e0e\u5206\u6790 \u73b0\u8c61 \u6211\u5f00\u59cb\u5c31\u8ba4\u4e3a\u662f\u6743\u9650\u95ee\u9898\uff0c\u201caccess rights\u201d\u3002 22-05-18\/Users\/XXXXX\/study\/flasktest~%&gt;git pull ERROR: Repository not found. fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository &hellip; <a href=\"http:\/\/madapapa.com\/wordpress\/?p=362\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">\u89e3\u51b3git\u65e0\u6cd5push\u7684\u95ee\u9898<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[44,5],"tags":[],"class_list":["post-362","post","type-post","status-publish","format-standard","hentry","category-flask","category-linux"],"_links":{"self":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=362"}],"version-history":[{"count":1,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/362\/revisions"}],"predecessor-version":[{"id":363,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/362\/revisions\/363"}],"wp:attachment":[{"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=362"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/madapapa.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}