{"id":99358,"date":"2026-09-02T14:25:17","date_gmt":"2026-09-02T06:25:17","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/99358.html"},"modified":"2026-09-02T14:25:17","modified_gmt":"2026-09-02T06:25:17","slug":"%e5%9c%a8%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e5%88%9b%e5%bb%ba%e4%b8%80%e4%b8%aa%e7%a7%81%e6%9c%89%e5%8c%96%e7%9a%84git","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/99358.html","title":{"rendered":"\u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u4e00\u4e2a\u79c1\u6709\u5316\u7684git"},"content":{"rendered":"<\/p>\n<hr \/>\n<h2>&#x1f680; 1. \u5728 Ubuntu \u670d\u52a1\u5668\u521b\u5efa\u4e00\u4e2a gituser&#xff08;\u5982\u679c\u5df2\u7ecf\u6709\u53ef\u8df3\u8fc7&#xff09;<\/h2>\n<p>sudo adduser gituser<\/p>\n<p>\u8bbe\u7f6e\u5bc6\u7801 \u2192 \u5b8c\u6210\u3002<\/p>\n<hr \/>\n<h2>&#x1f680; 2. \u628a\u672c\u5730 Windows \u7684 SSH Key \u653e\u5230\u670d\u52a1\u5668\u4e0a&#xff08;\u5f3a\u70c8\u63a8\u8350&#xff09;<\/h2>\n<h3>\u25b6\ufe0f&#xff08;1&#xff09;\u672c\u5730 Windows \u751f\u6210 SSH key<\/h3>\n<p>\u5728 PowerShell \u8f93\u5165&#xff1a;<\/p>\n<p>ssh-keygen -t ed25519 -C &#034;yourname&#034;<\/p>\n<p>\u4e00\u8def\u6309\u56de\u8f66&#xff0c;\u9ed8\u8ba4\u751f\u6210&#xff1a;<\/p>\n<p>C:\\\\Users\\\\\u4f60\u7684\u7528\u6237\u540d\\\\.ssh\\\\id_ed25519<br \/>\nC:\\\\Users\\\\\u4f60\u7684\u7528\u6237\u540d\\\\.ssh\\\\id_ed25519.pub<\/p>\n<hr \/>\n<h3>\u25b6\ufe0f&#xff08;2&#xff09;\u628a\u516c\u94a5\u4e0a\u4f20\u5230 Ubuntu \u670d\u52a1\u5668&#xff08;\u63a8\u8350 ssh-copy-id&#xff0c;\u5982\u679c\u6ca1\u6709\u53ef\u624b\u52a8&#xff09;&#xff1a;<\/h3>\n<p>\u5982\u679c\u4f60\u80fd\u7528 root \u767b\u5f55&#xff1a;<\/p>\n<p>ssh-copy-id -i ~\/.ssh\/id_ed25519.pub gituser&#064;\u670d\u52a1\u5668IP<\/p>\n<p>\u5982\u679c\u6ca1\u6709 ssh-copy-id \u5c31\u624b\u52a8&#xff1a;<\/p>\n<p>mkdir -p \/home\/gituser\/.ssh<br \/>\nchmod 700 \/home\/gituser\/.ssh<\/p>\n<p>\u628a Windows \u7684 id_ed25519.pub \u5185\u5bb9\u590d\u5236\u5e76\u5199\u5165&#xff1a;<\/p>\n<p>nano \/home\/gituser\/.ssh\/authorized_keys<\/p>\n<p>\u4fdd\u5b58&#xff0c;\u8bbe\u7f6e\u6743\u9650&#xff1a;<\/p>\n<p>chmod 600 \/home\/gituser\/.ssh\/authorized_keys<br \/>\nchown -R gituser:gituser \/home\/gituser\/.ssh<\/p>\n<hr \/>\n<h2>&#x1f680; 3. SSH \u767b\u5f55\u670d\u52a1\u5668\u7684 gituser \u8d26\u6237<\/h2>\n<p>\u4ece Windows&#xff1a;<\/p>\n<p>ssh gituser&#064;\u670d\u52a1\u5668IP<\/p>\n<p>\u5982\u679c\u6210\u529f\u4ee3\u8868 SSH key \u914d\u7f6e\u6210\u529f\u3002<\/p>\n<hr \/>\n<h2>&#x1f680; 4. \u5728\u670d\u52a1\u5668\u521b\u5efa\u4e00\u4e2a Git \u8fdc\u7a0b\u4ed3\u5e93&#xff08;Bare Repo&#xff09;<\/h2>\n<p>\u4f8b\u5982\u6258\u7ba1\u4f60\u7684\u9879\u76ee&#xff1a;<\/p>\n<p>su &#8211; gituser<\/p>\n<p>mkdir -p ~\/repos\/myproject.git<br \/>\ncd ~\/repos\/myproject.git<br \/>\ngit init &#8211;bare<\/p>\n<p>\u4f60\u73b0\u5728\u5f97\u5230\u4e86\u4e00\u4e2a\u8fdc\u7a0b\u4ed3\u5e93&#xff1a;<\/p>\n<p>gituser&#064;\u670d\u52a1\u5668IP:~\/repos\/myproject.git<\/p>\n<hr \/>\n<h2>&#x1f680; 5. \u672c\u5730 Windows \u4e0a\u521d\u59cb\u5316 Git \u9879\u76ee<\/h2>\n<p>\u8fdb\u5165\u4f60\u7684\u4ee3\u7801\u76ee\u5f55&#xff1a;<\/p>\n<p>cd D:\\\\MatchCode\\\\DataMining<br \/>\ngit init<br \/>\ngit add .<br \/>\ngit commit -m &#034;first commit&#034;<\/p>\n<hr \/>\n<h2>&#x1f680; 6. \u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93<\/h2>\n<p>git remote add origin gituser&#064;\u670d\u52a1\u5668IP:~\/repos\/myproject.git<\/p>\n<hr \/>\n<h2>&#x1f680; 7. \u63a8\u9001\u5230\u670d\u52a1\u5668&#xff08;\u7b2c\u4e00\u6b21\u53ef\u80fd\u9700\u8981 master\/main&#xff09;<\/h2>\n<p>git push -u origin master<\/p>\n<p>\u6210\u529f\u770b\u5230\u63a8\u9001&#xff0c;\u8868\u793a\u6574\u4e2a\u94fe\u8def\u7545\u901a\u3002<\/p>\n<hr \/>\n<h2>&#x1f680; 8. \u670d\u52a1\u5668 clone \u51fa\u5de5\u4f5c\u76ee\u5f55&#xff08;\u975e bare&#xff09;<\/h2>\n<p>bare \u4ed3\u5e93\u4e0d\u80fd\u76f4\u63a5\u8fd0\u884c&#xff0c;\u5fc5\u987b checkout \u4e00\u4efd&#xff1a;<\/p>\n<p>\u5728\u670d\u52a1\u5668&#xff1a;<\/p>\n<p>cd ~<br \/>\ngit clone ~\/repos\/myproject.git myproject<\/p>\n<p>\u4ee5\u540e\u66f4\u65b0\u53ef\u6267\u884c&#xff1a;<\/p>\n<p>cd ~\/myproject<br \/>\ngit pull<\/p>\n<hr \/>\n<h2>\u2764\ufe0f \u5230\u6b64\u5b8c\u6210&#xff01;\u672c\u5730 Windows \u5f00\u53d1 \u2192 \u4e00\u952e\u63a8\u9001\u5230 Ubuntu \u670d\u52a1\u5668<\/h2>\n<p>\u6d41\u7a0b\u56fe&#xff1a;<\/p>\n<p>Windows \u5f00\u53d1\u4ee3\u7801<br \/>\n\u2502<br \/>\n\u2502 git push<br \/>\n\u25bc<br \/>\nUbuntu 24.04 (gituser)<br \/>\n~\/repos\/myproject.git  (bare repo)<br \/>\n\u2502<br \/>\n\u2502 git clone \/ git pull<br \/>\n\u25bc<br \/>\n~\/myproject            (\u771f\u6b63\u8fd0\u884c\u7684\u4ee3\u7801\u76ee\u5f55)<\/p>\n<hr \/>\n<h2><\/h2>\n<p>\u4f60\u7684\u670d\u52a1\u5668\u53ef\u4ee5\u540c\u65f6\u62e5\u6709\u591a\u4e2a\u72ec\u7acb\u9879\u76ee&#xff0c;\u6bcf\u4e2a\u9879\u76ee\u4e00\u4e2a\u72ec\u7acb\u7684 bare \u4ed3\u5e93&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>~\/repos\/project1.git<br \/>\n~\/repos\/project2.git<br \/>\n~\/repos\/my_flask_app.git<br \/>\n~\/repos\/my_ai_model.git<br \/>\n~\/repos\/myproject_new.git<\/p>\n<p>\u53ea\u8981\u4f60\u613f\u610f&#xff0c;\u53ef\u4ee5\u5efa 100 \u4e2a\u90fd\u6ca1\u95ee\u9898\u3002<\/p>\n<p>\u4e0b\u9762\u7ed9\u4f60\u4e00\u4e2a\u6700\u6e05\u6670\u3001\u6700\u5b9e\u7528\u7684\u591a\u9879\u76ee\u540c\u6b65\u6a21\u677f\u3002<\/p>\n<hr \/>\n<h2>\u2705 1. \u5728\u670d\u52a1\u5668\u521b\u5efa\u65b0\u7684\u4ed3\u5e93 myproject_new.git<\/h2>\n<p>\u4ee5 gituser \u8eab\u4efd&#xff1a;<\/p>\n<p>mkdir -p ~\/repos\/myproject_new.git<br \/>\ncd ~\/repos\/myproject_new.git<br \/>\ngit init &#8211;bare<\/p>\n<hr \/>\n<h2>\u2705 2. \u672c\u5730 Windows \u65b0\u9879\u76ee\u94fe\u63a5\u8fd9\u4e2a\u8fdc\u7a0b\u4ed3\u5e93<\/h2>\n<p>\u5047\u8bbe\u4f60\u672c\u5730\u65b0\u9879\u76ee\u76ee\u5f55\u662f&#xff1a;<\/p>\n<p>D:\\\\Projects\\\\myproject_new<\/p>\n<p>\u521d\u59cb\u5316&#xff1a;<\/p>\n<p>cd D:\\\\Projects\\\\myproject_new<br \/>\ngit init<br \/>\ngit add .<br \/>\ngit commit -m &#034;init project&#034;<\/p>\n<p>\u6dfb\u52a0\u8fdc\u7a0b&#xff1a;<\/p>\n<p>git remote add origin gituser&#064;\u670d\u52a1\u5668IP:~\/repos\/myproject_new.git<\/p>\n<p>\u63a8\u9001&#xff1a;<\/p>\n<p>git push -u origin master<\/p>\n<p>\u6210\u529f&#xff01;<\/p>\n<hr \/>\n<h2>\u2705 3. \u670d\u52a1\u5668\u4e0a clone \u51fa\u53ef\u8fd0\u884c\u76ee\u5f55&#xff08;\u975e bare&#xff09;<\/h2>\n<p>\u4ecd\u7136\u662f gituser&#xff1a;<\/p>\n<p>cd ~<br \/>\ngit clone ~\/repos\/myproject_new.git myproject_new<\/p>\n<p>\u4ee5\u540e\u66f4\u65b0\u7684\u65f6\u5019&#xff0c;\u5230&#xff1a;<\/p>\n<p>~\/myproject_new<\/p>\n<p>\u8fd0\u884c&#xff1a;<\/p>\n<p>git pull<\/p>\n<hr \/>\n<h2>&#x1f525; \u5b8c\u6574\u793a\u4f8b&#xff1a;\u4f60\u7684\u591a\u4e2a\u9879\u76ee\u4f1a\u8fd9\u6837\u7ec4\u7ec7<\/h2>\n<p>\/home\/gituser\/<br \/>\n\u251c\u2500\u2500 repos\/<br \/>\n\u2502   \u251c\u2500\u2500 myproject.git<br \/>\n\u2502   \u251c\u2500\u2500 myproject_new.git<br \/>\n\u2502   \u251c\u2500\u2500 webapp.git<br \/>\n\u2502   \u2514\u2500\u2500 ai_service.git<br \/>\n\u2502<br \/>\n\u251c\u2500\u2500 myproject\/<br \/>\n\u2502   \u2514\u2500\u2500 &#xff08;\u771f\u6b63\u8fd0\u884c\u7684\u4ee3\u7801&#xff09;<br \/>\n\u251c\u2500\u2500 myproject_new\/<br \/>\n\u2502   \u2514\u2500\u2500 &#xff08;\u771f\u6b63\u8fd0\u884c\u7684\u4ee3\u7801&#xff09;<br \/>\n\u251c\u2500\u2500 webapp\/<br \/>\n\u2514\u2500\u2500 ai_service\/<\/p>\n<p>\u6bcf\u4e2a\u9879\u76ee\u5f00\u53d1-\u540c\u6b65\u6d41\u7a0b&#xff1a;<\/p>\n<li>\n<p>\u5728 Windows \u7f16\u5199\u4ee3\u7801<\/p>\n<\/li>\n<li>\n<p>git add . &amp;&amp; git commit -m &#034;update&#034;<\/p>\n<\/li>\n<li>\n<p>git push<\/p>\n<\/li>\n<li>\n<p>\u5728\u670d\u52a1\u5668 cd ~\/myproject_new &amp;&amp; git pull<\/p>\n<\/li>\n<p>\u987a\u6ed1\u65e0\u6bd4\u3002<\/p>\n<hr \/>\n<h2><\/h2>\n<p>\u4e0b\u9762\u7ed9\u4f60\u4e00\u5957 \u6700\u6807\u51c6\u3001\u6700\u7a33\u59a5\u3001\u4e00\u6b65\u5230\u4f4d \u7684\u6d41\u7a0b\u3002 \u4f60\u53ea\u9700\u8981 \u590d\u5236\u7c98\u8d34 \u5373\u53ef\u628a\u672c\u5730&#xff1a;<\/p>\n<p>D:\\\\MatchCode\\\\DataMining<\/p>\n<p>\u540c\u6b65\u5230\u4f60\u670d\u52a1\u5668\u7684 bare \u4ed3\u5e93&#xff1a;<\/p>\n<p>~\/repos\/DataMining.git   &#xff08;gituser \u7528\u6237&#xff09;<\/p>\n<hr \/>\n<h2>\u2705 \u7b2c\u4e00\u6b65&#xff1a;\u670d\u52a1\u5668\u7aef&#xff08;Ubuntu 24.04&#xff09;\u521b\u5efa bare \u4ed3\u5e93<\/h2>\n<p>\u4f60\u73b0\u5728\u5e94\u8be5\u7528 gituser \u767b\u5f55\u670d\u52a1\u5668&#xff0c;\u5982\u679c\u4f60\u8fd8\u5728 root \u4e0b&#xff0c;\u8bf7\u5148\u5207\u6362&#xff1a;<\/p>\n<p>su &#8211; gituser<\/p>\n<p>\u7136\u540e\u521b\u5efa\u4ed3\u5e93\u76ee\u5f55&#xff1a;<\/p>\n<p>mkdir -p ~\/repos\/DataMining.git<br \/>\ncd ~\/repos\/DataMining.git<br \/>\ngit init &#8211;bare<\/p>\n<p>\u73b0\u5728\u4f60\u7684\u670d\u52a1\u5668\u4ed3\u5e93\u5df2\u51c6\u5907\u597d\u63a5\u6536 push\u3002<\/p>\n<hr \/>\n<h2>\u2705 \u7b2c\u4e8c\u6b65&#xff1a;\u672c\u5730&#xff08;Windows 11&#xff09;\u7ed9\u4f60\u7684\u9879\u76ee\u6dfb\u52a0 remote<\/h2>\n<p>\u6253\u5f00 PowerShell&#xff0c;\u8fdb\u5165\u4f60\u7684\u9879\u76ee\u76ee\u5f55&#xff1a;<\/p>\n<p>cd D:\\\\MatchCode\\\\DataMining<\/p>\n<p>\u67e5\u770b\u672c\u5730\u662f\u5426\u5df2\u521d\u59cb\u5316 Git&#xff1a;<\/p>\n<p>git status<\/p>\n<p>\u5982\u679c\u672a\u521d\u59cb\u5316&#xff1a;<\/p>\n<p>git init<br \/>\ngit add .<br \/>\ngit commit -m &#034;Initial commit&#034;<\/p>\n<p>\u518d\u6dfb\u52a0\u8fdc\u7a0b\u4ed3\u5e93 origin&#xff1a;<\/p>\n<p>git remote add origin gituser&#064;\u670d\u52a1\u5668IP:~\/repos\/DataMining.git<\/p>\n<p>\u2714 \u6ce8\u610f&#xff0c;gituser&#064;\u670d\u52a1\u5668IP \u524d\u4e0d\u8981\u52a0 ssh:\/\/ \u2714 ~\/repos\/DataMining.git \u4e0d\u8981\u6f0f .git<\/p>\n<hr \/>\n<h2>\u2705 \u7b2c\u4e09\u6b65&#xff1a;\u628a\u672c\u5730\u5168\u90e8\u4ee3\u7801\u63a8\u9001\u5230\u670d\u52a1\u5668<\/h2>\n<p>\u5982\u679c\u4f60\u672c\u5730\u5206\u652f\u53eb main&#xff08;\u65b0\u7248 Git \u9ed8\u8ba4\u5982\u6b64&#xff09;&#xff1a;<\/p>\n<p>git push -u origin main<\/p>\n<p>\u5982\u679c\u4f60\u672c\u5730\u5206\u652f\u53eb master&#xff1a;<\/p>\n<p>git push -u origin master<\/p>\n<p>\u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u4f60\u5f53\u524d\u5206\u652f\u53eb\u4ec0\u4e48&#xff1a;<\/p>\n<p>git branch<\/p>\n<p>\u770b\u5230\u524d\u9762\u6709 * \u7684\u5c31\u662f\u5f53\u524d\u5206\u652f\u3002<\/p>\n<hr \/>\n<h2>&#x1f6a8; \u82e5\u63a8\u9001\u65f6\u62a5\u9519&#xff08;\u5e38\u89c1&#xff09;&#xff1a;<\/h2>\n<p>error: failed to push some refs&#8230;<\/p>\n<p>\u8bf4\u660e\u670d\u52a1\u5668\u7aef\u4ed3\u5e93\u4e0d\u662f\u5b8c\u5168\u7a7a\u7684&#xff0c;\u53ef\u4ee5\u5f3a\u63a8&#xff1a;<\/p>\n<p>git push -u origin main &#8211;force<\/p>\n<p>\u6216\u8005 master&#xff1a;<\/p>\n<p>git push -u origin master &#8211;force<\/p>\n<hr \/>\n<h2>\u2705 \u7b2c\u56db\u6b65&#xff1a;\u786e\u8ba4\u670d\u52a1\u5668\u7aef\u662f\u5426\u6210\u529f\u63a5\u6536<\/h2>\n<p>\u670d\u52a1\u5668\u7aef\u6267\u884c&#xff1a;<\/p>\n<p>cd ~\/repos\/DataMining.git<\/p>\n<p>\u67e5\u770b\u662f\u5426\u6709 objects &#xff1a;<\/p>\n<p>du -sh .<\/p>\n<p>\u5982\u679c\u6709\u51e0\u5341 KB ~ \u51e0 MB&#xff0c;\u5219\u8bf4\u660e\u63a5\u6536\u6210\u529f\u3002<\/p>\n<p>\u5982\u679c\u4f60\u9700\u8981\u90e8\u7f72\u5b9e\u9645\u4ee3\u7801&#xff08;\u4e0d\u662f bare \u4ed3\u5e93&#xff09;&#xff0c;\u53ef\u4ee5 clone&#xff1a;<\/p>\n<p>cd ~<br \/>\ngit clone ~\/repos\/DataMining.git DataMining<\/p>\n<p>\u670d\u52a1\u5668\u7684\u5b9e\u9645\u8fd0\u884c\u76ee\u5f55&#xff1a;<\/p>\n<p>~\/DataMining\/<\/p>\n<hr \/>\n<p>\u5728\u4f60\u7684 \u672c\u5730 Windows \u9879\u76ee\u76ee\u5f55 \u4e0b&#xff0c;\u53ea\u9700\u8981\u6267\u884c\u4e00\u6761\u547d\u4ee4\u5373\u53ef\u5220\u9664\u8fd9\u4e2a\u8fdc\u7aef\u670d\u52a1\u5668\u914d\u7f6e&#xff1a;<\/p>\n<h2>\u2705 \u5220\u9664 origin \u8fdc\u7a0b\u4ed3\u5e93<\/h2>\n<p>\u8fdb\u5165\u4f60\u7684\u9879\u76ee\u76ee\u5f55&#xff1a;<\/p>\n<p>cd D:\\\\MatchCode\\\\DataMining<\/p>\n<p>\u5220\u9664\u8fdc\u7a0b\u4ed3\u5e93 origin&#xff1a;<\/p>\n<p>git remote remove origin<\/p>\n<p>\u6216\u8005&#xff1a;<\/p>\n<p>git remote rm origin<\/p>\n<p>\u4e24\u79cd\u5199\u6cd5\u5b8c\u5168\u4e00\u6837\u3002<\/p>\n<hr \/>\n<h2>\u2705 \u67e5\u770b\u662f\u5426\u5df2\u7ecf\u5220\u9664\u6210\u529f<\/h2>\n<p>git remote -v<\/p>\n<p>\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u8f93\u51fa&#xff0c;\u8bf4\u660e\u8fdc\u7a0b\u4ed3\u5e93\u5df2\u7ecf\u88ab\u79fb\u9664\u3002<\/p>\n<hr \/>\n<h2>&#x1f527; \u5982\u679c\u4f60\u6709\u591a\u4e2a\u8fdc\u7aef&#xff08;\u6bd4\u5982 origin\u3001backup\u3001prod&#xff09;&#xff0c;\u4e5f\u53ef\u4ee5\u5206\u522b\u5220\u9664&#xff1a;<\/h2>\n<p>git remote rm backup<br \/>\ngit remote rm prod<\/p>\n<hr \/>\n<p>\u8981\u5728 \u53e6\u5916\u4e00\u53f0\u7535\u8111 \/ \u672c\u5730\u5176\u4ed6\u76ee\u5f55 \u514b\u9686\u4f60\u670d\u52a1\u5668\u4e0a\u7684\u4ed3\u5e93&#xff0c;\u53ea\u9700\u8981\u6267\u884c\u4e00\u6b21\u6807\u51c6\u7684 git clone&#xff1a;<\/p>\n<hr \/>\n<h2>\u2705 \u514b\u9686\u670d\u52a1\u5668\u4e0a\u7684 Git \u4ed3\u5e93&#xff08;\u6807\u51c6\u65b9\u5f0f&#xff09;<\/h2>\n<p>\u5728\u4efb\u610f\u672c\u5730\u76ee\u5f55\u6267\u884c&#xff1a;<\/p>\n<p>git clone gituser&#064;\u670d\u52a1\u5668IP:~\/repos\/DataMining.git<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>git clone gituser&#064;1.2.3.4:~\/repos\/DataMining.git<\/p>\n<p>\u514b\u9686\u540e\u4f1a\u751f\u6210\u4e00\u4e2a\u76ee\u5f55 DataMining&#xff1a;<\/p>\n<p>DataMining\/<br \/>\n \u251c\u2500\u2500 app.py<br \/>\n \u251c\u2500\u2500 src\/<br \/>\n \u251c\u2500\u2500 &#8230;<\/p>\n<hr \/>\n<h2>&#x1f511; \u6ce8\u610f&#xff1a;\u4f60\u5fc5\u987b\u4fdd\u8bc1\u670d\u52a1\u5668\u7684 gituser \u6709\u8bfb\u6743\u9650<\/h2>\n<p>\u4f60\u4e4b\u524d\u5e94\u8be5\u6267\u884c\u4e86&#xff08;\u6216\u8005\u6211\u5e2e\u4f60\u5199\u8fc7&#xff09;&#xff1a;<\/p>\n<p>sudo chown -R gituser:gituser \/home\/gituser\/repos<\/p>\n<p>\u4ed3\u5e93\u5c5e\u4e8e gituser&#xff0c;\u4f60\u7528 gituser&#064;IP \u767b\u5f55\u65f6\u5c31\u6ca1\u95ee\u9898\u3002<\/p>\n<hr \/>\n<h2>&#x1f527; \u5982\u679c\u4f60\u4f7f\u7528 SSH key&#xff08;\u63a8\u8350&#xff09;<\/h2>\n<h4>\u672c\u5730\u751f\u6210 key&#xff1a;<\/h4>\n<p>ssh-keygen -t rsa -b 4096<\/p>\n<p>\u590d\u5236\u516c\u94a5\u5230\u670d\u52a1\u5668&#xff1a;<\/p>\n<p>ssh-copy-id gituser&#064;\u670d\u52a1\u5668IP<\/p>\n<p>\u7136\u540e\u5c31\u53ef\u4ee5 \u514d\u5bc6\u7801 clone&#xff1a;<\/p>\n<p>git clone gituser&#064;\u670d\u52a1\u5668IP:~\/repos\/DataMining.git<\/p>\n<hr \/>\n<h2>&#x1f4cc; \u5e38\u89c1\u9519\u8bef\u4e0e\u89e3\u51b3\u65b9\u5f0f<\/h2>\n<h4>\u274c Permission denied (publickey)<\/h4>\n<p>\u8bf4\u660e\u670d\u52a1\u5668\u6ca1\u52a0\u5165\u672c\u5730\u7684\u516c\u94a5&#xff0c;\u91cd\u65b0\u6267\u884c&#xff1a;<\/p>\n<p>ssh-copy-id gituser&#064;\u670d\u52a1\u5668IP<\/p>\n<hr \/>\n<h4>\u274c fatal: &#039;repos\/DataMining.git&#039; does not appear to be a git repository<\/h4>\n<p>\u8bf4\u660e\u4f60\u6ca1\u6709\u521d\u59cb\u5316\u88f8\u4ed3\u5e93&#xff0c;\u8bf7\u786e\u8ba4\u670d\u52a1\u5668\u7aef\u76ee\u5f55\u7ed3\u6784&#xff1a;<\/p>\n<p>ls -l \/home\/gituser\/repos<\/p>\n<p>\u5e94\u8be5\u770b\u5230&#xff1a;<\/p>\n<p>DataMining.git\/<\/p>\n<p>\u91cc\u9762\u5e94\u8be5\u6709&#xff1a;<\/p>\n<p>HEAD<br \/>\nconfig<br \/>\nrefs\/<br \/>\nobjects\/<br \/>\nhooks\/<\/p>\n<hr \/>\n<h2><\/h2>\n<p>\u8fdb\u4e00\u6b65<\/p>\n<h2>\u5b89\u88c5 Gitea<\/h2>\n<p>Gitea \u662f\u8f7b\u91cf\u7684 Git \u670d\u52a1\u5668&#xff0c;\u8d85\u7ea7\u7b80\u5355&#xff0c;\u652f\u6301&#xff1a;<\/p>\n<p>\u2714 \u7f51\u9875\u754c\u9762&#xff08;\u50cf GitHub&#xff09; \u2714 \u9879\u76ee\u7ba1\u7406 \u2714 SSH &#043; HTTPS \u2714 \u7528\u6237\u7ba1\u7406 \u2714 \u79c1\u6709\u4ed3\u5e93 \u2714 1 \u5206\u949f\u90e8\u7f72<\/p>\n<hr \/>\n<h3>&#x1f7e2; \u5b89\u88c5\u6b65\u9aa4&#xff1a;<\/h3>\n<li>\n<p>\u4e0b\u8f7d Windows \u7248 Gitea&#xff1a; https:\/\/dl.gitea.com\/gitea\/<\/p>\n<\/li>\n<p>\u8fd0\u884c\u540e\u7a0b\u5e8f\u65e5\u5fd7\u5982\u4e0b&#xff0c;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"494\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260902062515-6a97c14b7ca62.png\" width=\"980\" \/><\/p>\n<p>\u6211\u4eec\u6570\u636e\u5e93\u9009sqlite\u5c31\u884c&#xff0c;\u6ce8\u518c\u4e00\u4e2a\u7ba1\u7406\u5458\u5e10\u53f7<\/p>\n<p>\u7136\u540e&#xff0c;\u4fee\u6539custom\\\\conf\\\\app.ini\u6ce8\u610f\u8def\u5f84\u5728\u8d77\u59cb\u7684\u65e5\u5fd7\u91cc<\/p>\n<p>\u4fee\u6539\u5982\u4e0b\u5185\u5bb9&#xff0c;<\/p>\n<p>[service] DISABLE_REGISTRATION &#061; true REQUIRE_SIGNIN_VIEW &#061; false \u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"542\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260902062515-6a97c14bab88e.png\" width=\"448\" \/><\/p>\n<p>\u7136\u540e\u5c31\u53ef\u4ee5\u4e86,linux\u63a8\u8350\u7528\u8fd9\u79cd\u00a0 \u4f7f\u7528\u00a0 sudo snap install gitea &#xff0c;\u7136\u540e\u8bbf\u95ee3000\u7aef\u53e3&#xff0c;\u914d\u7f6e\u4e0ewindows\u4e0a\u4e00\u6837<\/p>\n<p>gitea v1.25.1 from Gitea installed<br \/>\n(base) user&#064;user-desktop:~$ gitea<br \/>\n2025\/11\/19 11:40:37 cmd\/web.go:266:runWeb() [I] Starting Gitea on PID: 22743<br \/>\n2025\/11\/19 11:40:37 cmd\/web.go:114:showWebStartupMessage() [I] Gitea version: 1.25.1 built with GNU Make 4.3, go1.25.3 : bindata, sqlite, sqlite_unlock_notify, pam, cert<br \/>\n2025\/11\/19 11:40:37 cmd\/web.go:115:showWebStartupMessage() [I] * RunMode: prod<br \/>\n2025\/11\/19 11:40:37 cmd\/web.go:116:showWebStartupMessage() [I] * AppPath: \/snap\/gitea\/7667\/gitea<br \/>\n2025\/11\/19 11:40:37 cmd\/web.go:117:showWebStartupMessage() [I] * WorkPath: \/var\/snap\/gitea\/common<br \/>\n2025\/11\/19 11:40:37 cmd\/web.go:118:showWebStartupMessage() [I] * CustomPath: \/var\/snap\/gitea\/common<br \/>\n2025\/11\/19 11:40:37 cmd\/web.go:119:showWebStartupMessage() [I] * ConfigFile: \/var\/snap\/gitea\/common\/conf\/app.ini<br \/>\n2025\/11\/19 11:40:37 cmd\/web.go:120:showWebStartupMessage() [I] Prepare to run install page<br \/>\n2025\/11\/19 11:40:39 cmd\/web.go:328:listen() [I] Listen: http:\/\/0.0.0.0:3000<br \/>\n2025\/11\/19 11:40:39 cmd\/web.go:332:listen() [I] AppURL(ROOT_URL): http:\/\/localhost:3000\/<br \/>\n2025\/11\/19 11:40:39 modules\/graceful\/server.go:50:NewServer() [I] Starting new Web server: tcp:0.0.0.0:3000 on PID: 22743<br \/>\n2025\/11\/19 11:40:39 modules\/graceful\/server.go:76:(*Server).ListenAndServe() [E] Unable to GetListener: listen tcp 0.0.0.0:3000: bind: address already in use<br \/>\n2025\/11\/19 11:40:39 cmd\/web.go:377:listen() [E] Failed to start server: listen tcp 0.0.0.0:3000: bind: address already in use<br \/>\n2025\/11\/19 11:40:39 cmd\/web.go:379:listen() [I] HTTP Listener: 0.0.0.0:3000 Closed<br \/>\n2025\/11\/19 11:40:39 cmd\/web.go:152:serveInstall() [E] Unable to open listener for installer. Is Gitea already running?<br \/>\n2025\/11\/19 11:40:39 modules\/graceful\/manager.go:176:(*Manager).doHammerTime() [W] Setting Hammer condition<br \/>\n2025\/11\/19 11:40:40 modules\/graceful\/manager.go:192:(*Manager).doTerminate() [W] Terminating<br \/>\n2025\/11\/19 11:40:40 &#8230;\/graceful\/manager_unix.go:154:(*Manager).handleSignals() [W] PID: 22743. Background context for manager closed &#8211; context canceled &#8211; Shutting down&#8230;<br \/>\n2025\/11\/19 11:40:40 cmd\/web.go:158:serveInstall() [I] PID: 22743 Gitea Web Finished<br \/>\nCommand error: listen tcp 0.0.0.0:3000: bind: address already in use<\/p>\n<p>\u5728 Ubuntu \u4f7f\u7528 snap \u5b89\u88c5 gitea \u65f6&#xff0c;\u914d\u7f6e\u6587\u4ef6 app.ini \u5e76\u4e0d\u5728\u4f20\u7edf\u7684 \/etc\/gitea\/ \u6216 \/var\/lib\/gitea\/&#xff0c;\u800c\u662f\u88ab snap \u653e\u5728\u81ea\u5df1\u7684\u9694\u79bb\u76ee\u5f55\u4e2d\u3002<\/p>\n<p>\u4e0b\u9762\u7ed9\u4f60\u6700\u51c6\u786e\u7684 snap \u7248 gitea \u914d\u7f6e\u6587\u4ef6\u8def\u5f84&#xff1a;<\/p>\n<hr \/>\n<h2>\u2705 snap \u5b89\u88c5\u7684 Gitea&#xff1a;app.ini \u8def\u5f84<\/h2>\n<p>\/var\/snap\/gitea\/current\/custom\/conf\/app.ini<\/p>\n<p>\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u547d\u4ee4\u786e\u8ba4&#xff1a;<\/p>\n<p>sudo ls \/var\/snap\/gitea\/current\/custom\/conf\/<\/p>\n<p>\u5982\u679c\u76ee\u5f55\u4e0d\u5b58\u5728&#xff0c;\u9700\u8981\u624b\u52a8\u521b\u5efa&#xff1a;<\/p>\n<p>sudo mkdir -p \/var\/snap\/gitea\/current\/custom\/conf<br \/>\nsudo nano \/var\/snap\/gitea\/current\/custom\/conf\/app.ini<\/p>\n<hr \/>\n<h2>&#x1f4cc; \u67e5\u770b snap gitea \u65e5\u5fd7&#xff08;\u91cc\u9762\u4e5f\u4f1a\u63d0\u793a custom \u76ee\u5f55\u8def\u5f84&#xff09;<\/h2>\n<p>sudo journalctl -u snap.gitea.gitea -f<\/p>\n<p>\u65e5\u5fd7\u5f00\u5934\u901a\u5e38\u4f1a\u663e\u793a&#xff1a;<\/p>\n<p>Custom path: \/var\/snap\/gitea\/current\/custom<br \/>\nConfig file: \/var\/snap\/gitea\/current\/custom\/conf\/app.ini<\/p>\n<hr \/>\n<h2>\u2728 \u4fee\u6539\u793a\u4f8b&#xff08;\u4f60\u7684\u914d\u7f6e&#xff09;<\/h2>\n<p>\u7f16\u8f91\u6587\u4ef6&#xff1a;<\/p>\n<p>sudo nano \/var\/snap\/gitea\/current\/custom\/conf\/app.ini<\/p>\n<p>\u52a0\u5165&#xff1a;<\/p>\n<p>[service]<br \/>\nDISABLE_REGISTRATION &#061; true<br \/>\nREQUIRE_SIGNIN_VIEW &#061; false<\/p>\n<p>\u4fdd\u5b58\u540e\u91cd\u542f\u670d\u52a1&#xff1a;<\/p>\n<p>sudo snap restart gitea<\/p>\n<p>snap list gitea snap services gitea<\/p>\n<p>\u603b\u7ed3\u4e00\u4e0b&#xff0c;\u8fd8\u662f\u7528gitea\u65b9\u4fbf<\/p>\n<hr \/>\n<p>\u6839\u636e\u4f60\u7ed9\u51fa\u7684\u7ed3\u679c&#xff1a;<\/p>\n<p>$ git branch -vv<br \/>\n  develop 0367eb4 [origin\/develop: behind 1] \u4fee\u590d\u95ee\u9898<br \/>\n* master  78a1b76 [origin\/master: ahead 536] \u589e\u52a0\u4e66\u7b7e\u4fee\u590d&#xff0c;<\/p>\n<p>\u8fd9\u91cc\u7ed9\u51fa\u4e86\u975e\u5e38\u660e\u786e\u7684\u4fe1\u606f&#xff1a;<\/p>\n<hr \/>\n<h2>\u2705 *\u4f60\u5f53\u524d\u6240\u5728\u5206\u652f&#xff1a;master&#xff08;\u524d\u9762\u6709 &#xff09;<\/h2>\n<p>* master  78a1b76 [origin\/master: ahead 536]<\/p>\n<p>\u8fd9\u4e00\u884c\u544a\u8bc9\u6211\u4eec 2 \u4e2a\u5173\u952e\u70b9&#xff1a;<\/p>\n<hr \/>\n<h2>\u2460 master \u6b63\u5728\u8ddf\u8e2a&#xff08;tracking&#xff09;&#xff1a;<\/h2>\n<p>origin\/master<\/p>\n<p>\u8fd9\u8bf4\u660e&#xff1a;<\/p>\n<h4>&#x1f3af; \u6267\u884c git push \u65f6\u7684\u9ed8\u8ba4\u63a8\u9001\u76ee\u6807&#xff0c;\u5c31\u662f origin\/master<\/h4>\n<p>\u4e5f\u5c31\u662f&#xff1a;<\/p>\n<p>ssh:\/\/sunyuzhe&#064;xxxx.xxx:29418\/cde\/pc\/compliance<\/p>\n<hr \/>\n<h2>\u2461 master \u5f53\u524d\u6bd4 origin\/master \u201c\u9886\u5148 536 \u4e2a\u63d0\u4ea4\u201d<\/h2>\n<p>[origin\/master: ahead 536]<\/p>\n<p>\u8bf4\u660e\u4f60\u6709 536 \u4e2a\u672c\u5730\u63d0\u4ea4\u6ca1\u6709\u63a8\u5230 origin\u3002<\/p>\n<hr \/>\n<h2>&#x1f4cc; \u6240\u4ee5\u4f60\u7684\u95ee\u9898\u7b54\u6848\u975e\u5e38\u660e\u786e&#xff1a;<\/h2>\n<h3>&#x1f449; \u73b0\u5728\u4e0d\u52a0\u4efb\u4f55\u53c2\u6570\u8f93\u5165&#xff1a;<\/h3>\n<p>git push<\/p>\n<p>\u9ed8\u8ba4\u63a8\u9001\u5230&#xff1a;<\/p>\n<h4>\u2714 origin\/master<\/h4>\n<p>&#xff08;gerrit \u4ed3\u5e93&#xff09;<\/p>\n<hr \/>\n<h2>\u2757 \u5982\u679c\u4f60\u60f3\u63a8\u9001\u5230 gitea\/master \u800c\u4e0d\u662f origin\/master<\/h2>\n<p>\u4f60\u8981\u660e\u786e\u6307\u5b9a remote&#xff1a;<\/p>\n<p>git push gitea master<\/p>\n<p>\u4f46\u4f60\u4e4b\u524d\u7684 gitea push \u63d0\u793a \u201cFailed to authenticate\u201d&#xff0c;\u8bf4\u660e\u9700\u8981&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u6b63\u786e\u8d26\u53f7\u5bc6\u7801<\/p>\n<\/li>\n<li>\n<p>\u6216 token<\/p>\n<\/li>\n<li>\n<p>\u6216\u7528 SSH \u914d\u7f6e<\/p>\n<\/li>\n<\/ul>\n<p>\u6211\u53ef\u4ee5\u5e2e\u4f60\u89e3\u51b3\u767b\u5f55\u95ee\u9898\u3002<\/p>\n<hr \/>\n<h2>\u2757 \u5982\u679c\u4f60\u60f3\u4ee5\u540e master \u9ed8\u8ba4\u63a8\u9001\u5230 gitea\/master \u800c\u4e0d\u662f origin\/master<\/h2>\n<p>\u6267\u884c&#xff1a;<\/p>\n<p>git branch &#8211;set-upstream-to&#061;gitea\/master master<\/p>\n<p>\u7136\u540e\u4ee5\u540e&#xff1a;<\/p>\n<p>git push<\/p>\n<p>\u5c31\u4f1a\u63a8\u9001\u5230&#xff1a;<\/p>\n<p>gitea\/master<\/p>\n<hr \/>\n<h2><\/h2>\n<p>\u53e6\u5916\u9488\u5bf9\u4e00\u4e2alinux \u4e0a\u7684\u9879\u76ee\u4e0a\u4f20\u5230gitea\u4e0a\u9762&#xff0c;\u4f7f\u7528remote http  <\/p>\n<p>git init \u4e4b\u540e<\/p>\n<p>\u5728\u670d\u52a1\u5668\u4e0a\u5efa\u7acb\u4e00\u4e2a\u9879\u76ee&#xff0c;\u6bd4\u5982\u53eb\u00a0orangePi6_mobile_detect<\/p>\n<p>\u7136\u540e<\/p>\n<p>git remote set-url origin http:\/\/su1.ltd:3000\/admin\/orangePi6_mobile_detect.git<\/p>\n<p>git push &#8211;set-upstream origin master<\/p>\n<p>\u8fd9\u65f6\u8981\u8f93\u5165\u5e10\u53f7 admin<\/p>\n<p>\u5bc6\u7801&#xff1a;\u4e0d\u662f\u767b\u5f55\u7684\u5bc6\u7801&#xff0c;\u800c\u662ftoken\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"900\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260902062515-6a97c14bbc694.png\" width=\"1169\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"655\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260902062516-6a97c14c2bf85.png\" width=\"1139\" \/><\/p>\n<p>\u53ea\u80fd\u4f7f\u7528\u4e00\u6b21\u5c31\u4e0d\u884c\u4e86<\/p>\n<\/p>\n<p>\u53e6\u5916\u522b\u7684http\u767b\u5f55\u4e0d\u4e86&#xff0c;\u8981\u6539\u8fdb\u4e00\u4e0b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"598\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260902062516-6a97c14c7014e.png\" width=\"686\" \/><\/p>\n<p>nano \/var\/snap\/gitea\/common\/conf\/app.ini<\/p>\n<p>[server]<br \/>\nDOMAIN &#061; su1.ltd<br \/>\nHTTP_PORT &#061; 3000<\/p>\n<p>[security]<br \/>\nENABLE_WEBAUTHN &#061; false<\/p>\n<p>\u5fc5\u987b\u91cd\u542f\u52a8gitea<br \/>\nsnap restart gitea <\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#x1f680; 1. \u5728 Ubuntu \u670d\u52a1\u5668\u521b\u5efa\u4e00\u4e2a gituser&#xff08;\u5982\u679c\u5df2\u7ecf\u6709\u53ef\u8df3\u8fc7&#xff09;<br \/>\nsudo adduser gituser\u8bbe\u7f6e\u5bc6\u7801 \u2192 \u5b8c\u6210\u3002 &#x1f680; 2. \u628a\u672c\u5730 Windows \u7684 SSH Key \u653e\u5230\u670d\u52a1\u5668\u4e0a&#xff08;\u5f3a\u70c8\u63a8\u8350&#xff09;<br \/>\n\u25b6\ufe0f&#xff08;1&#xff09;\u672c\u5730 Windows \u751f\u6210 SSH key<br \/>\n\u5728 PowerShell \u8f93\u5165&#xff1a;<br \/>\nssh-keygen -t ed<\/p>\n","protected":false},"author":2,"featured_media":99353,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[89,43,44],"topic":[],"class_list":["post-99358","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-git","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u4e00\u4e2a\u79c1\u6709\u5316\u7684git - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/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:\/\/www.wsisp.com\/helps\/99358.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u4e00\u4e2a\u79c1\u6709\u5316\u7684git - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"&#x1f680; 1. \u5728 Ubuntu \u670d\u52a1\u5668\u521b\u5efa\u4e00\u4e2a gituser&#xff08;\u5982\u679c\u5df2\u7ecf\u6709\u53ef\u8df3\u8fc7&#xff09; sudo adduser gituser\u8bbe\u7f6e\u5bc6\u7801 \u2192 \u5b8c\u6210\u3002 &#x1f680; 2. \u628a\u672c\u5730 Windows \u7684 SSH Key \u653e\u5230\u670d\u52a1\u5668\u4e0a&#xff08;\u5f3a\u70c8\u63a8\u8350&#xff09; \u25b6\ufe0f&#xff08;1&#xff09;\u672c\u5730 Windows \u751f\u6210 SSH key \u5728 PowerShell \u8f93\u5165&#xff1a; ssh-keygen -t ed\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/99358.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-02T06:25:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260902062515-6a97c14b7ca62.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99358.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/99358.html\",\"name\":\"\u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u4e00\u4e2a\u79c1\u6709\u5316\u7684git - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-02T06:25:17+00:00\",\"dateModified\":\"2026-09-02T06:25:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/99358.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/99358.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/99358.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u4e00\u4e2a\u79c1\u6709\u5316\u7684git\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u4e00\u4e2a\u79c1\u6709\u5316\u7684git - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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:\/\/www.wsisp.com\/helps\/99358.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u4e00\u4e2a\u79c1\u6709\u5316\u7684git - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"&#x1f680; 1. \u5728 Ubuntu \u670d\u52a1\u5668\u521b\u5efa\u4e00\u4e2a gituser&#xff08;\u5982\u679c\u5df2\u7ecf\u6709\u53ef\u8df3\u8fc7&#xff09; sudo adduser gituser\u8bbe\u7f6e\u5bc6\u7801 \u2192 \u5b8c\u6210\u3002 &#x1f680; 2. \u628a\u672c\u5730 Windows \u7684 SSH Key \u653e\u5230\u670d\u52a1\u5668\u4e0a&#xff08;\u5f3a\u70c8\u63a8\u8350&#xff09; \u25b6\ufe0f&#xff08;1&#xff09;\u672c\u5730 Windows \u751f\u6210 SSH key \u5728 PowerShell \u8f93\u5165&#xff1a; ssh-keygen -t ed","og_url":"https:\/\/www.wsisp.com\/helps\/99358.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-02T06:25:17+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260902062515-6a97c14b7ca62.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/99358.html","url":"https:\/\/www.wsisp.com\/helps\/99358.html","name":"\u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u4e00\u4e2a\u79c1\u6709\u5316\u7684git - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-02T06:25:17+00:00","dateModified":"2026-09-02T06:25:17+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/99358.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/99358.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/99358.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5728\u670d\u52a1\u5668\u4e0a\u521b\u5efa\u4e00\u4e2a\u79c1\u6709\u5316\u7684git"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=99358"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/99358\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/99353"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=99358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=99358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=99358"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=99358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}