{"id":23192120,"url":"https://github.com/fmw666/git","last_synced_at":"2026-05-03T10:33:32.350Z","repository":{"id":109449224,"uuid":"155717080","full_name":"fmw666/Git","owner":"fmw666","description":"🍋 Git的基本教程，及一些常用的操作指令、表情包系列、Markdown教程及常用排版和小技巧、docsify文档站点生成器入手等。还有一个Hexo+Github简易快速搭博客的教程说明，例如，我的博客，欢迎访问！","archived":false,"fork":false,"pushed_at":"2022-05-04T09:09:36.000Z","size":82359,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-27T01:40:57.805Z","etag":null,"topics":["blog","docsify","emoji","git","github","markdown"],"latest_commit_sha":null,"homepage":"https://fmw666.github.io/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fmw666.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-01T13:12:00.000Z","updated_at":"2022-05-04T09:09:42.000Z","dependencies_parsed_at":"2023-04-21T08:47:14.297Z","dependency_job_id":null,"html_url":"https://github.com/fmw666/Git","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fmw666/Git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmw666%2FGit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmw666%2FGit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmw666%2FGit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmw666%2FGit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fmw666","download_url":"https://codeload.github.com/fmw666/Git/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fmw666%2FGit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274753627,"owners_count":25342825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blog","docsify","emoji","git","github","markdown"],"created_at":"2024-12-18T12:19:51.711Z","updated_at":"2026-05-03T10:33:27.327Z","avatar_url":"https://github.com/fmw666.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📕Git基本教程\n\n*⚡[Git]()是目前世界上最先进的分布式版本控制系统（没有之一）。*\n\n添加 README.md 文档的作用：官方的说法是`Help people interested in this repository understand your project by adding a README.`\n\u003e 通过添加自述，帮助对这个存储库感兴趣的人理解您的项目。(来自有道翻译)\n\n- **在[Windows]()上安装[Git]()**\n\n  \u003e [Git官网](https://git-scm.com/downloads)直接下载安装程序，（网速慢的同学请移步[国内镜像](https://pan.baidu.com/s/1kU5OCOB#list/path=%2Fpub%2Fgit)）\n  \n  + 安装完成后，在开始菜单里找到`\"Git\"-\u003e\"Git Bash\"`,进行如下配置：\n  \n  ```git\n  $ git config --global user.name \"Your Name\"  \n  $ git config --global user.email \"email@example.com\"\n  ```\n  + 生成相应的令牌，本地一份，Github 一份，这样 Github 可以在你使用仓库的时候，进行校验确定你的身份。\n  \n  ```git\n  $ cd ~/.ssh\n  $ mkdir key_backup\n  $ ssh-keygen -t rsa -C \"email@example.com\"\n  ```\n  + 生成如下两个文件：\n  \n  \u003cdiv align=\"center\"\u003e \u003cimg src=\"https://i.loli.net/2018/11/01/5bdb01c742769.png\" width=\"450\"/\u003e \u003c/div\u003e\u003cbr\u003e\n  \n   \u003e `id_rsa.pub` 就是我们待会需要的公钥文件，使用命令 `$ cat id_rsa.pub` 再将内容复制到剪切板，然后进入github账号设置里面添加SSH key\n   \n   然后输入 `$ ssh -T git@github.com` 测试连通状态\n   \n- **创建本地仓库**\n\n  + 选择一个本地文件夹，用作保存本地仓库文件，尽量是空文件夹。\n  + 然后使用命令 `$ git init` 初始化文件夹。\n    \u003e 其实是在当前文件夹下生成一个叫 `.git` 的隐藏文件夹，里面是一些配置文件，不要随意更改。\n   \n  + 使用 `$ git clone https://github.com/name/repository.git` 将远程仓库克隆到本地此文件夹下。\n    \u003e [name]() 是自己的昵称，[repository]() 是自己的仓库名，不要忘记末尾的 `.git` 后缀。\n   \n  + 然后此文件夹下会多一个和你仓储名一样的文件夹，内部文件与远程仓库一样。\n  \n- **常用命令**\n\n  ```git\n  $ git add . //添加文件\n  $ git commit -m \"commit-messages\" //提交本地仓库\n  $ git push origin master //提交远程仓库\n  $ git pull //拉取远程文件，与以下命令类似\n  $ git branch temp //创建本地分支\n  $ git fetch origin master:temp\n  $ git merge master\n  ```\n  \n  \u003e **添加文件**\n  \n  ```git\n  $ git init\n  $ git clone https://github.com/name/repository.git\n  $ git add name.md                  #如果想一次全部添加则：git add -A\n  $ git commit -m '添加了name文件'    #提交并添加操作说明\n  $ git push origin master     \n  ```\n  \n  \u003e **删除文件夹**\n  \n  ```git\n  $ git init\n  $ git clone https://github.com/name/repository.git\n  $ git pull origin master        #将远程仓库里面的项目拉下来\n  $ git dir                       #查看有哪些文件夹\n  $ git rm -r --cached target     #删除target文件夹\n  $ git commit -m '删除了target文件夹'    #提交并添加操作说明\n  ```\n  \n  \u003e **上传超过100M的文件到github**\n  \n  ```git\n  $ git lfs install   #在本地仓库下安装lfs\n  #添加了大文件后...\n  $ git lfs track \"文件名.后缀名\"  #重要一步！ 正确会显示提示：'Tracking \"文件名.后缀名\"'\n  $ git add .\n  $ git commit -m \"提交信息\"\n  $ git push -u origin master\n  ```\n\n- **图床介绍**\n\n  *写博客就无法避免上传图片，图床就是这么一个地方，就是一个网站，你发自己的图片上传到它的网站，然后它给你一个这个图片的链接，插入博客中就能显示图片了。*\n  + 推荐一个知名的，七牛云[https://portal.qiniu.com/](https://portal.qiniu.com/)，注册完实名认证后有一些优惠。 \n  + 还有一个神奇的网站：[https://sm.ms/](https://sm.ms/)，也能用\n  \n- **Hexo+github博客搭建**  \n\n  + 推荐一个CSDN博主的文章，[点击这里](https://blog.csdn.net/Mr_yu_java/article/details/81077064)\n  + 一个git用户很详细的分享，[点击这里](https://hans2936.github.io/2018/06/06/HexoLog/)\n  + 当然，官方教程更全面，[点击这里](https://hexo.io/zh-cn/docs/deployment.html)\n  \n  *这里分享一篇我的总结，[点击这里](https://github.com/fmw666/Git/blob/master/Hexo%20%2B%20Github%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA.md)*\n  \n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmw666%2Fgit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffmw666%2Fgit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffmw666%2Fgit/lists"}