{"id":715,"date":"2021-01-18T14:50:25","date_gmt":"2021-01-18T06:50:25","guid":{"rendered":"http:\/\/blog.refusea.com\/?p=715"},"modified":"2021-01-18T14:50:25","modified_gmt":"2021-01-18T06:50:25","slug":"%e5%b0%86%e6%9c%ac%e5%9c%b0%e5%b7%a5%e7%a8%8b%e9%a6%96%e6%ac%a1%e6%8f%90%e4%ba%a4%e5%88%b0-gitee-%e8%bf%9c%e7%a8%8b%e4%bb%93%e5%ba%93","status":"publish","type":"post","link":"https:\/\/refusea.com\/?p=715","title":{"rendered":"\u5c06\u672c\u5730\u5de5\u7a0b\u9996\u6b21\u63d0\u4ea4\u5230 gitee \u8fdc\u7a0b\u4ed3\u5e93"},"content":{"rendered":"<h2>\u6982\u8ff0<\/h2>\n<p>\u5c06\u672c\u5730\u5df2\u5b58\u5728\u7684 python \u5de5\u7a0b refusea \u5b58\u50a8\u5230\u7801\u4e91\uff08gitee.com\uff09\u4e0a<\/p>\n<p>\u73af\u5883<\/p>\n<ul>\n<li>centos 8.2<\/li>\n<\/ul>\n<p>\u5de5\u7a0b\u76ee\u5f55<\/p>\n<ul>\n<li>\/data\/python\/refusea<\/li>\n<\/ul>\n<h2>\u5b89\u88c5 git<\/h2>\n<pre><code class=\"language-bash\">yum -y install git<\/code><\/pre>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u67e5\u770b git \u7248\u672c<\/p>\n<pre><code class=\"language-bash\">git --version\ngit version 2.27.0<\/code><\/pre>\n<h2>\u914d\u7f6e git<\/h2>\n<pre><code class=\"language-bash\">git config --global user.name &#039;refusea&#039;\ngit config --global user.email &#039;refusea@163.com&#039;\n# \u67e5\u770b\u914d\u7f6e\ngit config --list\nuser.name=refusea\nuser.email=refusea@163.com<\/code><\/pre>\n<h2>\u914d\u7f6e gitee \u516c\u94a5\u8ba4\u8bc1<\/h2>\n<p>\u6267\u884c\u4e0b\u8ff0\u547d\u4ee4\u521b\u5efa\u5bc6\u94a5\uff0c\u5982\u679c ~\/.ssh \u4e0b\u5df2\u5b58\u5728 id_rsa \u548c id_rsa.pub\uff0c\u5219\u8df3\u8fc7\u6b64\u6b65\u9aa4<\/p>\n<pre><code class=\"language-bash\">ssh-keygen -t rsa -C &quot;refusea@163.com&quot;<\/code><\/pre>\n<p>\u547d\u4ee4\u6267\u884c\u65f6\u8f93\u51fa\u5982\u4e0b\u5185\u5bb9\uff0c\u5176\u4e2d 3 \u6b21\u8be2\u95ee\uff0c\u76f4\u63a5\u56de\u8f66\u5373\u53ef<\/p>\n<pre><code class=\"language-bash\">Generating public\/private rsa key pair.\nEnter file in which to save the key (\/root\/.ssh\/id_rsa):\nEnter passphrase (empty for no passphrase):\nEnter same passphrase again:\nYour identification has been saved in \/root\/.ssh\/id_rsa.\nYour public key has been saved in \/root\/.ssh\/id_rsa.pub.\nThe key fingerprint is:\nSHA256:pcuGxPXfEt9z2mI0aMl\/ZbDP9edKs\/o+yuEKM+0CD+I refusea@163.com\nThe key&#039;s randomart image is:\n+---[RSA 3072]----+\n|                 |\n|                 |\n|        . .      |\n|     . . +    .  |\n|      o S ...o o |\n|    ..oo o .=++.+|\n|   . ..+B ..+o=**|\n|    E  .o= o +==O|\n|         .o.=***+|\n+----[SHA256]-----+<\/code><\/pre>\n<p>\u5bc6\u94a5\u521b\u5efa\u6210\u529f\u540e\uff0c\u5c06\u516c\u94a5\u6dfb\u52a0\u5230 gitee.com\uff08\u7565\uff09<\/p>\n<p>\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u6d4b\u8bd5\u516c\u94a5\u5df2\u751f\u6548<\/p>\n<pre><code class=\"language-bash\">ssh -T git@gitee.com\nThe authenticity of host &#039;gitee.com (180.97.125.228)&#039; can&#039;t be established.\nECDSA key fingerprint is SHA256:FQGC9Kn\/eye1W8icdBgrQp+KkGYoFgbVr17bmjey0Wc.\nAre you sure you want to continue connecting (yes\/no\/[fingerprint])?<\/code><\/pre>\n<p>\u8f93\u5165 yes<\/p>\n<pre><code class=\"language-bash\">Hi \u62d2\u6d77! You&#039;ve successfully authenticated, but GITEE.COM does not provide shell access.<\/code><\/pre>\n<p>\u516c\u94a5\u8ba4\u8bc1\u5df2\u914d\u7f6e\u6210\u529f<\/p>\n<h2>\u5728 gitee \u4e0a\u521b\u5efa\u4ed3\u5e93<\/h2>\n<p>\u4ed3\u5e93\u540d\u4e3a refusea<\/p>\n<h2>\u5c06\u672c\u5730\u4ee3\u7801\u63a8\u9001\u5230 gitee<\/h2>\n<p>\u5728\u5de5\u7a0b\u6839\u76ee\u5f55\u4e0b\u6267\u884c<\/p>\n<pre><code class=\"language-bash\">cd \/data\/python\/refusea\n\ngit init\ngit remote add origin git@gitee.com:refusea\/refusea.git<\/code><\/pre>\n<p>\u4ece\u8fdc\u7a0b\u4ed3\u5e93\u540c\u6b65<\/p>\n<pre><code class=\"language-bash\">git pull origin master\nwarning: Pulling without specifying how to reconcile divergent branches is\ndiscouraged. You can squelch this message by running one of the following\ncommands sometime before your next pull:\n\n  git config pull.rebase false  # merge (the default strategy)\n  git config pull.rebase true   # rebase\n  git config pull.ff only       # fast-forward only\n\nYou can replace &quot;git config&quot; with &quot;git config --global&quot; to set a default\npreference for all repositories. You can also pass --rebase, --no-rebase,\nor --ff-only on the command line to override the configured default per\ninvocation.\n\nremote: Enumerating objects: 9, done.\nremote: Counting objects: 100% (9\/9), done.\nremote: Compressing objects: 100% (8\/8), done.\nremote: Total 9 (delta 1), reused 0 (delta 0), pack-reused 0\nUnpacking objects: 100% (9\/9), 1.98 KiB | 1.98 MiB\/s, done.\nFrom gitee.com:refusea\/refusea\n * branch            master     -&gt; FETCH_HEAD\n * [new branch]      master     -&gt; origin\/master\nerror: The following untracked working tree files would be overwritten by merge:\n    .gitignore\nPlease move or remove them before you merge.\nAborting<\/code><\/pre>\n<p>\u62c9\u53d6\u4e0d\u6210\u529f\uff0c\u8fd9\u662f\u56e0\u4e3a\u672c\u5730\u6709\u540c\u540d\u7684\u6587\u4ef6 <code>.gitignore<\/code>\uff0c\u53ef\u4ee5\u5148\u5220\u9664\u8be5\u6587\u4ef6\uff0c\u5f85\u62c9\u53d6\u6210\u529f\u540e\u518d\u4fee\u6539\u56de\u6765<\/p>\n<pre><code class=\"language-bash\">rm .gitignore\nrm: remove regular file &#039;.gitignore&#039;? y<\/code><\/pre>\n<p>\u8fd9\u6b21\u53ef\u4ee5\u6210\u529f\u540c\u6b65\u4e86<\/p>\n<pre><code class=\"language-bash\">git pull origin master\nwarning: Pulling without specifying how to reconcile divergent branches is\ndiscouraged. You can squelch this message by running one of the following\ncommands sometime before your next pull:\n\n  git config pull.rebase false  # merge (the default strategy)\n  git config pull.rebase true   # rebase\n  git config pull.ff only       # fast-forward only\n\nYou can replace &quot;git config&quot; with &quot;git config --global&quot; to set a default\npreference for all repositories. You can also pass --rebase, --no-rebase,\nor --ff-only on the command line to override the configured default per\ninvocation.\n\nFrom gitee.com:refusea\/refusea\n * branch            master     -&gt; FETCH_HEAD<\/code><\/pre>\n<p>\u5c06\u5f53\u524d\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u6dfb\u52a0\u5230 git \u5e93\u5e76\u63d0\u4ea4<\/p>\n<pre><code class=\"language-bash\">git add .\ngit commit -m \u521d\u59cb\u5bfc\u5165<\/code><\/pre>\n<p>\u63a8\u9001\uff08\u9996\u6b21\u63d0\u4ea4\uff09\u5230 gitee<\/p>\n<pre><code class=\"language-bash\">git push\n\nfatal: The current branch master has no upstream branch.\nTo push the current branch and set the remote as upstream, use\n\n    git push --set-upstream origin master<\/code><\/pre>\n<p>\u76f4\u63a5 <code>push<\/code> \u5931\u8d25\u4e86\u6839\u636e\u63d0\u793a\uff0c\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4<\/p>\n<pre><code class=\"language-bash\">git push --set-upstream origin master\nEnumerating objects: 79, done.\nCounting objects: 100% (79\/79), done.\nDelta compression using up to 2 threads\nCompressing objects: 100% (74\/74), done.\nWriting objects: 100% (77\/77), 42.76 KiB | 6.11 MiB\/s, done.\nTotal 77 (delta 5), reused 0 (delta 0), pack-reused 0\nremote: Powered by GITEE.COM [GNK-5.0]\nTo gitee.com:refusea\/refusea.git\n   77ed942..107eaf6  master -&gt; master\nBranch &#039;master&#039; set up to track remote branch &#039;master&#039; from &#039;origin&#039;.<\/code><\/pre>\n<p>\u6210\u529f\u641e\u5b9a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8ff0 \u5c06\u672c\u5730\u5df2\u5b58\u5728\u7684 python \u5de5\u7a0b refusea \u5b58\u50a8\u5230\u7801\u4e91\uff08gitee.com\uff09\u4e0a \u73af\u5883 cento [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[57,34],"class_list":["post-715","post","type-post","status-publish","format-standard","hentry","category-26","tag-git","tag-vscode"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5c06\u672c\u5730\u5de5\u7a0b\u9996\u6b21\u63d0\u4ea4\u5230 gitee \u8fdc\u7a0b\u4ed3\u5e93 - \u62d2\u6d77\u7a7a\u95f4<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/refusea.com\/?p=715\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"refusea.com\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/refusea.com\/?p=715#article\",\"isPartOf\":{\"@id\":\"https:\/\/refusea.com\/?p=715\"},\"author\":{\"name\":\"refusea.com\",\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df\"},\"headline\":\"\u5c06\u672c\u5730\u5de5\u7a0b\u9996\u6b21\u63d0\u4ea4\u5230 gitee \u8fdc\u7a0b\u4ed3\u5e93\",\"datePublished\":\"2021-01-18T06:50:25+00:00\",\"dateModified\":\"2021-01-18T06:50:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/refusea.com\/?p=715\"},\"wordCount\":27,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df\"},\"keywords\":[\"git\",\"vscode\"],\"articleSection\":[\"\u5f00\u53d1\u6548\u7387\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/refusea.com\/?p=715#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/refusea.com\/?p=715\",\"url\":\"https:\/\/refusea.com\/?p=715\",\"name\":\"\u5c06\u672c\u5730\u5de5\u7a0b\u9996\u6b21\u63d0\u4ea4\u5230 gitee \u8fdc\u7a0b\u4ed3\u5e93 - \u62d2\u6d77\u7a7a\u95f4\",\"isPartOf\":{\"@id\":\"https:\/\/refusea.com\/#website\"},\"datePublished\":\"2021-01-18T06:50:25+00:00\",\"dateModified\":\"2021-01-18T06:50:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/refusea.com\/?p=715#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/refusea.com\/?p=715\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/refusea.com\/?p=715#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/refusea.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5c06\u672c\u5730\u5de5\u7a0b\u9996\u6b21\u63d0\u4ea4\u5230 gitee \u8fdc\u7a0b\u4ed3\u5e93\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/refusea.com\/#website\",\"url\":\"https:\/\/refusea.com\/\",\"name\":\"\u62d2\u6d77\u7a7a\u95f4\",\"description\":\"\u62d2\u6d77\u7684\u4e2a\u4eba\u535a\u5ba2\",\"publisher\":{\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/refusea.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df\",\"name\":\"refusea.com\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7f7489b4afdbd952db64e7a6704d1258?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7f7489b4afdbd952db64e7a6704d1258?s=96&d=mm&r=g\",\"caption\":\"refusea.com\"},\"logo\":{\"@id\":\"https:\/\/refusea.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/refusea.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5c06\u672c\u5730\u5de5\u7a0b\u9996\u6b21\u63d0\u4ea4\u5230 gitee \u8fdc\u7a0b\u4ed3\u5e93 - \u62d2\u6d77\u7a7a\u95f4","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/refusea.com\/?p=715","twitter_misc":{"\u4f5c\u8005":"refusea.com","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/refusea.com\/?p=715#article","isPartOf":{"@id":"https:\/\/refusea.com\/?p=715"},"author":{"name":"refusea.com","@id":"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df"},"headline":"\u5c06\u672c\u5730\u5de5\u7a0b\u9996\u6b21\u63d0\u4ea4\u5230 gitee \u8fdc\u7a0b\u4ed3\u5e93","datePublished":"2021-01-18T06:50:25+00:00","dateModified":"2021-01-18T06:50:25+00:00","mainEntityOfPage":{"@id":"https:\/\/refusea.com\/?p=715"},"wordCount":27,"commentCount":0,"publisher":{"@id":"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df"},"keywords":["git","vscode"],"articleSection":["\u5f00\u53d1\u6548\u7387"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/refusea.com\/?p=715#respond"]}]},{"@type":"WebPage","@id":"https:\/\/refusea.com\/?p=715","url":"https:\/\/refusea.com\/?p=715","name":"\u5c06\u672c\u5730\u5de5\u7a0b\u9996\u6b21\u63d0\u4ea4\u5230 gitee \u8fdc\u7a0b\u4ed3\u5e93 - \u62d2\u6d77\u7a7a\u95f4","isPartOf":{"@id":"https:\/\/refusea.com\/#website"},"datePublished":"2021-01-18T06:50:25+00:00","dateModified":"2021-01-18T06:50:25+00:00","breadcrumb":{"@id":"https:\/\/refusea.com\/?p=715#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/refusea.com\/?p=715"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/refusea.com\/?p=715#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/refusea.com\/"},{"@type":"ListItem","position":2,"name":"\u5c06\u672c\u5730\u5de5\u7a0b\u9996\u6b21\u63d0\u4ea4\u5230 gitee \u8fdc\u7a0b\u4ed3\u5e93"}]},{"@type":"WebSite","@id":"https:\/\/refusea.com\/#website","url":"https:\/\/refusea.com\/","name":"\u62d2\u6d77\u7a7a\u95f4","description":"\u62d2\u6d77\u7684\u4e2a\u4eba\u535a\u5ba2","publisher":{"@id":"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/refusea.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/refusea.com\/#\/schema\/person\/b5393cc8b15717000d19424552aae0df","name":"refusea.com","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/refusea.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7f7489b4afdbd952db64e7a6704d1258?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7f7489b4afdbd952db64e7a6704d1258?s=96&d=mm&r=g","caption":"refusea.com"},"logo":{"@id":"https:\/\/refusea.com\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/refusea.com"]}]}},"_links":{"self":[{"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/posts\/715"}],"collection":[{"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/refusea.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=715"}],"version-history":[{"count":4,"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/posts\/715\/revisions"}],"predecessor-version":[{"id":719,"href":"https:\/\/refusea.com\/index.php?rest_route=\/wp\/v2\/posts\/715\/revisions\/719"}],"wp:attachment":[{"href":"https:\/\/refusea.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/refusea.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/refusea.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}