{"id":37,"date":"2024-10-12T14:32:04","date_gmt":"2024-10-12T06:32:04","guid":{"rendered":"http:\/\/47.108.173.172\/?p=37"},"modified":"2024-11-15T16:55:07","modified_gmt":"2024-11-15T08:55:07","slug":"%e4%bd%bf%e7%94%a8git%e4%b8%8a%e4%bc%a0%e9%a1%b9%e7%9b%ae%e8%87%b3github","status":"publish","type":"post","link":"https:\/\/xieg.top\/index.php\/2024\/10\/12\/%e4%bd%bf%e7%94%a8git%e4%b8%8a%e4%bc%a0%e9%a1%b9%e7%9b%ae%e8%87%b3github\/","title":{"rendered":"\u4f7f\u7528Git\u4e0a\u4f20\u9879\u76ee\u81f3GitHub"},"content":{"rendered":"\n<p>\u9996\u5148\u6253\u5f00\u9879\u76ee\u6587\u4ef6\u5939, \u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u5c06\u9879\u76ee\u53d8\u6210Git\u53ef\u7ba1\u7406\u7684\u4ed3\u5e93; \u6267\u884c\u6210\u529f\u540e\u5c06\u80fd\u591f\u770b\u5230<code>.git<\/code>\u6587\u4ef6\u5939, \u8be5\u6587\u4ef6\u5939\u7528\u4e8e\u8ddf\u8e2a\u548c\u7ba1\u7406\u7248\u672c\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"border-width:1px;border-radius:10px;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10)\"><code>git init<\/code><\/pre>\n\n\n\n<p>\u968f\u540e\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u5c06\u6587\u4ef6\u5939\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u6dfb\u52a0\u5230Git\u4ed3\u5e93\u4e2d<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"border-width:1px;border-radius:10px;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10)\"><code>git add .<\/code><\/pre>\n\n\n\n<p>\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u67e5\u770b\u662f\u5426\u6210\u529f\u6dfb\u52a0\u4e86\u6587\u4ef6, \u7eff\u8272\u4ee3\u8868\u6210\u529f\u6dfb\u52a0, \u7ea2\u8272\u4ee3\u8868\u6dfb\u52a0\u5931\u8d25<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"border-width:1px;border-radius:10px;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10)\"><code>git status<\/code><\/pre>\n\n\n\n<p>\u5c06\u6587\u4ef6\u5939\u63d0\u4ea4\u5230Git\u4ed3\u5e93, \u5f15\u53f7\u4e2d\u8868\u793a\u63d0\u4ea4\u6240\u5e26\u7684\u6ce8\u91ca\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"border-width:1px;border-radius:10px;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10)\"><code>git commit -m \"first commit\"<\/code><\/pre>\n\n\n\n<p>\u968f\u540e\u786e\u4fdd\u5df2\u7ecf\u521b\u5efa\u4e86<code>SSH KEY<\/code>, \u53ef\u4ee5\u5728\u7528\u6237\u6587\u6863\u76ee\u5f55\u4e0b\u67e5\u770b<code>.ssh<\/code>\u6587\u4ef6\u5939, \u5982\u679c\u6ca1\u6709\u521b\u5efa, \u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u521b\u5efa; \u521b\u5efa\u6210\u529f\u540e, \u5c06<code>id_rsa.pub<\/code>\u6dfb\u52a0\u5230GitHub\u4e2d<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"border-width:1px;border-radius:10px;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10)\"><code>ssh-keygen -t rsa -C \"john201950@outlook.com\"<\/code><\/pre>\n\n\n\n<p>\u968f\u540e\u5728GitHub\u65b0\u5efa\u4ed3\u5e93, \u65b0\u5efa\u6210\u529f\u540e\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u5c06\u672c\u5730\u4ed3\u5e93\u4e0eGitHub\u4ed3\u5e93\u5173\u8054<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"border-width:1px;border-radius:10px;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10)\"><code>git remote add origin https:\/\/github.com\/chenphxx\/translator.git<\/code><\/pre>\n\n\n\n<p>\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u8fd9\u4e00\u884c\u547d\u4ee4\u53d6\u6d88\u5173\u8054<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"border-width:1px;border-radius:10px;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10)\"><code>git remote remove origin<\/code><\/pre>\n\n\n\n<p>\u5173\u8054\u6210\u529f\u540e\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u65b0\u5efa<code>mian<\/code>\u5206\u652f<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"border-width:1px;border-radius:10px;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10);font-size:px\"><code>git branch -M main<\/code><\/pre>\n\n\n\n<p>\u5c06\u4ed3\u5e93\u9879\u76ee\u63a8\u5230\u4ed3\u5e93\u7684<code>main<\/code>\u5206\u652f<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"border-width:1px;border-radius:10px;padding-top:var(--wp--preset--spacing--10);padding-right:var(--wp--preset--spacing--10);padding-bottom:var(--wp--preset--spacing--10);padding-left:var(--wp--preset--spacing--10)\"><code>git push -u origin main<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u9700\u8981\u8f93\u5165\u7528\u6237\u540d\u4e0e\u5bc6\u7801, \u5219\u5728\u7b2c\u4e8c\u6b21\u8f93\u5165\u5bc6\u7801\u65f6, \u53ef\u80fd\u9700\u8981\u7528\u6237\u7684<code>Personal Token<\/code>, \u53ef\u4ee5\u5728GitHub\u8bbe\u7f6e\u4e2d\u9009\u62e9<code>Developer settings<\/code>\u4e2d\u521b\u5efa<code>Token(classic)<\/code>\u7ecf\u5178\u4ee4\u724c, \u7136\u540e\u4f7f\u7528\u8be5\u4ee4\u724c\u767b\u5f55<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u6253\u5f00\u9879\u76ee\u6587\u4ef6\u5939, \u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u5c06\u9879\u76ee\u53d8\u6210Git\u53ef\u7ba1\u7406\u7684\u4ed3\u5e93; \u6267\u884c\u6210\u529f\u540e\u5c06\u80fd\u591f\u770b\u5230.git\u6587\u4ef6\u5939, \u8be5\u6587 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-git"],"_links":{"self":[{"href":"https:\/\/xieg.top\/index.php\/wp-json\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xieg.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xieg.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xieg.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xieg.top\/index.php\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":1,"href":"https:\/\/xieg.top\/index.php\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"predecessor-version":[{"id":38,"href":"https:\/\/xieg.top\/index.php\/wp-json\/wp\/v2\/posts\/37\/revisions\/38"}],"wp:attachment":[{"href":"https:\/\/xieg.top\/index.php\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xieg.top\/index.php\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xieg.top\/index.php\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}