快速入门(不用指令),使用VSCode和Git管理代码和提交到远程服务器(GitHub) - 教程
<style>pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", monospace !important; font-size: 14px !important; line-height: 1.6 !important; padding: 16px !important; margin: 16px 0 !important; background-color: rgba(248, 248, 248, 1) !important; border: 1px solid rgba(225, 228, 232, 1) !important; border-radius: 6px !important; tab-size: 4 !important; -moz-tab-size: 4 !important; max-width: 100% !important; box-sizing: border-box !important }code { font-family: "Consolas", "Monaco", "Courier New", monospace !important; font-size: 14px !important; white-space: pre !important; word-wrap: normal !important; word-break: normal !important; overflow-wrap: normal !important; display: inline !important; background: rgba(0, 0, 0, 0) !important; border: none !important; padding: 0 !important; margin: 0 !important; line-height: inherit !important }
pre code { background: rgba(0, 0, 0, 0) !important; border: 0 !important; border-radius: 0 !important; display: block !important; line-height: 1.6 !important; margin: 0 !important; max-width: none !important; overflow: visible !important; padding: 0 !important; white-space: pre !important; word-wrap: normal !important; word-break: normal !important; color: inherit !important }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: rgba(112, 128, 144, 1) !important; font-style: italic !important }
.token.punctuation { color: rgba(153, 153, 153, 1) !important }
.token.atrule, .token.attr-value, .token.keyword { color: rgba(0, 119, 170, 1) !important; font-weight: bold !important }
.token.function, .token.class-name { color: rgba(221, 74, 104, 1) !important; font-weight: bold !important }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: rgba(102, 153, 0, 1) !important }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: rgba(153, 0, 85, 1) !important }
.cnblogs-markdown pre, .cnblogs-post-body pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; background-color: rgba(248, 248, 248, 1) !important; border: 1px solid rgba(225, 228, 232, 1) !important; border-radius: 6px !important; padding: 16px !important; margin: 16px 0 !important }
pre, pre, pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important }</style>
<div class="htmledit_views atom-one-dark" id="content_views"><h4>一、下载Git和VScode,网上资料很多,这里就不赘述了</h4><h4>二、打开VSCode,确认Git下载完成</h4><p><img alt="" height="1072" src="https://i-blog.csdnimg.cn/direct/3d207592b3fc4a6b8ecd4269a3abd032.png" width="1309"></p><h4>三、新建一个文件夹(尽量使用英文名,我这里带了中文!)并使用VSCode打开,在文件夹下面新建一个文件,随便写点东西并保存</h4><p><img alt="" height="665" src="https://i-blog.csdnimg.cn/direct/562fd2330df04f47a2348b06d9e854a7.png" width="1123"></p><h4>四、第一次初始化仓库,会出现一个弹窗,点击“始终”即可</h4><p><img alt="" height="831" src="https://i-blog.csdnimg.cn/direct/39ab81cad2f3438a92e679f775ed1ab2.png" width="1459"></p><p><img alt="" height="1263" src="https://i-blog.csdnimg.cn/direct/02476d3d99f047aaa12678b25c9a1045.png" width="1683"></p><h4>五、先给提交起个名称,再点击提交,此时又会出现一个弹窗,点击“取消”</h4><p><img alt="" height="838" src="https://i-blog.csdnimg.cn/direct/ee99e9f3fd5b4c2f8fdcdd969308e5b5.png" width="1368"></p><h4>六、打开命令行终端,输入以下命令</h4>
<pre style="white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important"><code class="language-bash">git config --global user.name "用户名"
git config --global user.email 邮箱地址</code></pre>
<p><img alt="" height="1411" src="https://i-blog.csdnimg.cn/direct/5dfff3940275499082bce3be2dab2fc5.png" width="1829"></p><p><img alt="" height="126" src="https://i-blog.csdnimg.cn/direct/5e9a5710b65c4f288898265c69ac985b.png" width="1155"></p><h4>七、之后再次点击提交,即可提交成功</h4><p><img alt="" height="1048" src="https://i-blog.csdnimg.cn/direct/a372d0cebf3b41fdb40f8720d031ec66.png" width="1316"></p><h4>八、再次重复之前步骤,执行第二次提交</h4><p><img alt="" height="765" src="https://i-blog.csdnimg.cn/direct/9200f5ce213e417384a11a83f1428a25.png" width="1386"></p><p><img alt="" height="1100" src="https://i-blog.csdnimg.cn/direct/16ac4ad3d9694c03992f64879c31fe60.png" width="1569"></p><h4>九、能够在vscode下方看到两次提交,可以点击查看</h4><p><img alt="" height="1183" src="https://i-blog.csdnimg.cn/direct/10f9529c17664ea68623f3a9029c6c43.png" width="2288"></p><h4>十、之前的提交都是在本地电脑上进行的,也就是说大家并没有提交到远程服务器中,以下是如何提交到github中。点击发布,出现弹窗,点击“允许”,跳转到浏览器中登录github,然后授权vscode使用github,之后回到vscode,会出现设置为共有还是私有选项,选择哪个点击即可(过程中出现卡顿,可能需要设置代理!!!)</h4><p><img alt="" height="1194" src="https://i-blog.csdnimg.cn/direct/c677774d73a1478786d676d76a85613c.png" width="1703"></p><p><img alt="" height="1243" src="https://i-blog.csdnimg.cn/direct/59ef2661b67342a8ab859e7d1d3bf66b.png" width="1705"><img alt="" height="180" src="https://i-blog.csdnimg.cn/direct/f353d7329e4347fc8d599509654ef14b.png" width="1690"></p><h4>十一、登录我们的github,会发现刚才提交的项目出现在仓库中</h4><p><img alt="" height="907" src="https://i-blog.csdnimg.cn/direct/8c9c926c8bfe404bac7f91a0d0fd0c19.png" width="1473"></p><p></p></div><br><br>
来源:https://www.cnblogs.com/yangykaifa/p/19258825
頁:
[1]