上传本地代码及更新代码到GitHub教程
<h1 id="大体分三步">大体分三步</h1><h1 id="no1-建立本地仓库">NO.1 建立本地仓库</h1>
<h1 id="no2-建立远程仓库">NO.2 建立远程仓库</h1>
<h1 id="no3-建立二者的关系">NO.3 建立二者的关系</h1>
<h2 id="一-建立本地仓库">一. 建立本地仓库</h2>
<h3 id="第一步在本地建一个文件夹如-my-test">第一步:在本地建一个文件夹(如: my-test)</h3>
<h3 id="第二步进入文件夹-打开-git-黑窗口-输入--git-init---按回车">第二步:进入文件夹 打开 git 黑窗口 输入 < git init >按回车</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112193119318-1948429668.png" alt="" loading="lazy"></p>
<h3 id="文件夹中会出现-git-文件-说明成功了">文件夹中会出现 .git 文件 说明成功了</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112193653260-1691806287.png" alt="" loading="lazy"></p>
<h3 id="git-黑窗口-输入--git-status--查看仓库的状态--此时仓库是新的-工作区-暂存区-都是空的">git 黑窗口 输入 < git status > 查看仓库的状态此时仓库是新的 工作区 暂存区 都是空的</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112194514209-399408817.png" alt="" loading="lazy"></p>
<h3 id="第三步在文件夹my-test内-新建一个-文件-如-readmemd">第三步:在文件夹my-test内 新建一个 文件 如 (README.md)</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112193828227-1400650462.png" alt="" loading="lazy"></p>
<h3 id="git-黑窗口-再次输入--git-status--查看仓库的状态-此时在-工作区-就多了一个文件-readmemd">git 黑窗口 再次输入 < git status > 查看仓库的状态 此时在 工作区 就多了一个文件 README.md</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112194747923-502007666.png" alt="" loading="lazy"></p>
<h3 id="第四步-git-黑窗口-输入---git-add-readmemd---按回车-意思就是把-工作区的-readmemd-文件-添加到暂存区">第四步: git 黑窗口 输入 <git add README.md >按回车 意思就是把 工作区的 README.md 文件 添加到暂存区</h3>
<h3 id="git-黑窗口-再次输入--git-status--查看仓库的状态-此时在-暂存区-就多了一个文件-readmemd">git 黑窗口 再次输入 < git status > 查看仓库的状态 此时在 暂存区 就多了一个文件 README.md</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112195058785-1543729869.png" alt="" loading="lazy"></p>
<h3 id="第五步-git-黑窗口-输入--git-commit--m-这是我的第一次提交---按回车-意思就是把-暂存区的文件提交">第五步: git 黑窗口 输入 < git commit -m "这是我的第一次提交" >按回车 意思就是把 暂存区的文件提交</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112195345390-728457636.png" alt="" loading="lazy"></p>
<h3 id="然后-git-黑窗口-输入--git-log---就可以看到自己提交点">然后 git 黑窗口 输入 < git log >就可以看到自己提交点</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112195528178-846843557.png" alt="" loading="lazy"></p>
<h2 id="到此本地的仓库建成了-而且有一次提交">到此本地的仓库建成了 而且有一次提交</h2>
<h2 id="二-建立github仓库">二. 建立github仓库</h2>
<h3 id="第一步去github上创建自己的repository创建页面如下图所示">第一步:去github上创建自己的Repository,创建页面如下图所示:</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112190459601-1947867670.png" alt="" loading="lazy"></p>
<h3 id="第二步点击后-创建页面如下图所示">第二步:点击后 创建页面如下图所示:</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112190931755-1021978376.png" alt="" loading="lazy"></p>
<h3 id="第三步到此-远端仓库建成了-">第三步:到此, 远端仓库建成了 :</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112192625856-606370518.png" alt="" loading="lazy"></p>
<h2 id="三-关联本地仓库和远端github仓库">三. 关联本地仓库和远端github仓库</h2>
<h3 id="第一步复制此代码-">第一步:复制此代码 :</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112200324546-1920651787.png" alt="" loading="lazy"></p>
<h3 id="第二步-git-黑窗口-右键-粘贴-后回车">第二步: git 黑窗口 右键 粘贴 后回车</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112200521671-337632889.png" alt="" loading="lazy"></p>
<h3 id="粘贴后如下所示-按回车">粘贴后如下所示 按回车</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112200553685-1123505814.png" alt="" loading="lazy"><br>
然后 git 黑窗口 输入 <git push -u origin master ><br>
<img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112200915290-907894346.png" alt="" loading="lazy"></p>
<h3 id="出现此说明成功了-可以查看自己的github仓库-就有提交的内容了">出现此说明成功了 可以查看自己的github仓库 就有提交的内容了</h3>
<p><img src="https://img2018.cnblogs.com/blog/1315467/201911/1315467-20191112201028855-1860144692.png" alt="" loading="lazy"></p>
<h3 id="中间可能会让你输入username和password你只要输入github的账号和密码就行了执行完后如果没有异常等待执行完就上传成功了">中间可能会让你输入Username和Password,你只要输入github的账号和密码就行了。执行完后,如果没有异常,等待执行完就上传成功了</h3><br><br>
来源:https://www.cnblogs.com/chuhx/p/11844872.html
頁:
[1]