1. github新建库
(1)点击右上角头像附近加号,选择new repository
(2)然后填写库名称和说明
然后create repository
(3)然后会生成一个云端的储存库地址,把它复制剪贴板
(4)在本地建立一个文件夹,例如:F:\WorkPlace\git\web,然后在web文件夹里写个README.txt,然后右键打开git命令行,初始化git本地仓库
(5)打开命令行,输入git init回车,(初始化本地git仓库)
(6)再输入git add . (注意git + 空格 + add + 空格 + .)点就是选中目录下所有文件,(把文件填充到本地git缓存)
(7)再输入git commit -m "仓库说明" (把缓存里的文件提交到本地git仓库)
(8)然后输入git remote add origin + 空格 + 你刚刚从github上复制的库地址 回车 (本地git仓库与云端github仓库建立通道)
(9)最后输入git push -u origin master回车 (把本地git库中的文件上传到github)
(10)看到To https://github.com/.....就说明文件已经上传到github上面了,然后回到自己的github,刷新页面,可以看到自己建立的库以及刚刚上传的README.txt
2. 添加库说明(可以看到git库的说明“welcome to my gitHub!”)点击Edit可以更改库的说明
3. 新建文件夹
(1)点击create new file
(2)在MyWeb/后写“文件夹名 + / ”
(3)然后在文件夹下随便添加一个文件 回车 例如:
在文件里随便写点东西 例如
(4)最后滑到下面点击 commit new file
这样就新建了一个文件夹(每次新建文件夹都要写个文件在里面,不然文件夹建立不了)
4. 上传文件到github目录、删除文件夹、删除库、访问github文件
(1)上传文件, 点击upload files
然后拖入想上传的文件
(2)删除文件、文件夹
删除文件,打开文件,右上角点击垃圾桶
删除文件夹 : 删掉文件下所有文件,文件夹也就随之消失了。
(3)删除库,例如删除MyWeb库
点击右上角settings
滑到最下面,点击delete this repository将会删除整个库!
(4)访问github文件
例如 : 访问库里的Helloworld.html (GitHub托管)
打开这个库的settings
下滑到GitHub Pages , 为这个库配置一个分支
然后使用分支 + HTML 访问页面
例如 https://saber2pr.github.io/MyWeb/HelloWorld/HelloWorld.html
显示了html中的内容
<li class="tool-item tool-active is-like "><a href="javascript:;"><svg class="icon" aria-hidden="true"> <use xlink:href="#csdnc-thumbsup"></use> </svg><span class="name">点赞</span> <span class="count"></span> </a></li> <li class="tool-item tool-active is-collection "><a href="javascript:;" data-report-click="{"mod":"popu_824"}"><svg class="icon" aria-hidden="true"> <use xlink:href="#icon-csdnc-Collection-G"></use> </svg><span class="name">收藏</span></a></li> <li class="tool-item tool-active is-share"><a href="javascript:;" data-report-click="{"mod":"1582594662_002"}"><svg class="icon" aria-hidden="true"> <use xlink:href="#icon-csdnc-fenxiang"></use> </svg>分享</a></li> <!--打赏开始--> <!--打赏结束--> <li class="tool-item tool-more"> <a> <svg t="1575545411852" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5717" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M179.176 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5718"></path><path d="M509.684 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5719"></path><path d="M846.175 499.222m-113.245 0a113.245 113.245 0 1 0 226.49 0 113.245 113.245 0 1 0-226.49 0Z" p-id="5720"></path></svg> </a> <ul class="more-box"> <li class="item"><a class="article-report">文章举报</a></li> </ul> </li> </ul> </div> </div> <div class="person-messagebox"> <div class="left-message"><a href="https://blog.csdn.net/u011607490"> <img src="https://profile.csdnimg.cn/8/E/F/3_u011607490" class="avatar_pic" username="u011607490"> <img src="https://g.csdnimg.cn/static/user-reg-year/1x/7.png" class="user-years"> </a></div> <div class="middle-message"> <div class="title"><span class="tit"><a href="https://blog.csdn.net/u011607490" data-report-click="{"mod":"popu_379"}" target="_blank">Prpr_Saber</a></span> </div> <div class="text"><span>发布了101 篇原创文章</span> · <span>获赞 43</span> · <span>访问量 14万+</span></div> </div> <div class="right-message"> <a href="https://im.csdn.net/im/main.html?userName=u011607490" target="_blank" class="btn btn-sm btn-red-hollow bt-button personal-letter">私信 </a> <a class="btn btn-sm bt-button personal-watch" data-report-click="{"mod":"popu_379"}">关注</a> </div> </div> </div> </article>