{"id":21644377,"url":"https://github.com/vectorxxxx/note_git","last_synced_at":"2025-10-05T00:09:24.544Z","repository":{"id":91477207,"uuid":"407189357","full_name":"vectorxxxx/NOTE_Git","owner":"vectorxxxx","description":"尚硅谷5h打通Git全套教程IDEA版（涵盖GitHub Gitee码云 GitLab）/ 尚硅谷Git教程全套完整版（12h深入掌握git）学习笔记","archived":false,"fork":false,"pushed_at":"2021-10-19T12:41:25.000Z","size":81,"stargazers_count":20,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T18:22:07.736Z","etag":null,"topics":["git","gitee","github","gitlab"],"latest_commit_sha":null,"homepage":"","language":null,"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/vectorxxxx.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,"zenodo":null}},"created_at":"2021-09-16T14:07:56.000Z","updated_at":"2025-03-16T19:26:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ddee975-1db8-44a2-937b-485110d0bd46","html_url":"https://github.com/vectorxxxx/NOTE_Git","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vectorxxxx/NOTE_Git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorxxxx%2FNOTE_Git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorxxxx%2FNOTE_Git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorxxxx%2FNOTE_Git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorxxxx%2FNOTE_Git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vectorxxxx","download_url":"https://codeload.github.com/vectorxxxx/NOTE_Git/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vectorxxxx%2FNOTE_Git/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278391236,"owners_count":25978951,"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-10-04T02:00:05.491Z","response_time":63,"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":["git","gitee","github","gitlab"],"created_at":"2024-11-25T05:39:53.074Z","updated_at":"2025-10-05T00:09:24.538Z","avatar_url":"https://github.com/vectorxxxx.png","language":null,"readme":"# NOTE_Git\n\n## 介绍\n\n:sparkles: 尚硅谷5h打通Git全套教程IDEA版（涵盖GitHub Gitee码云 GitLab）/ 尚硅谷Git教程全套完整版（12h深入掌握git）\n\n\n\n## 更新\n\n- :link: Github：[vectorxxxx/NOTE_Git: 尚硅谷5h打通Git全套教程IDEA版（涵盖GitHub Gitee码云 GitLab）/ 尚硅谷Git教程全套完整版（12h深入掌握git）](https://github.com/vectorxxxx/NOTE_Git)\n- :link: Gitee：[NOTE_Git: 尚硅谷5h打通Git全套教程IDEA版（涵盖GitHub Gitee码云 GitLab）/ 尚硅谷Git教程全套完整版（12h深入掌握git）](https://gitee.com/vectorx/NOTE_Git)\n- :link: CC：[VectorUx / NOTE_Git · CODE CHINA (csdn.net)](https://codechina.csdn.net/qq_35925558/NOTE_Git)\n- :link: 语雀：[Git 从入门到精通 · 语雀 (yuque.com)](https://www.yuque.com/u21195183/noi9ey)\n- :link: 博客园：[Git从入门到精通 - 随笔分类 - VectorX - 博客园 (cnblogs.com)](https://www.cnblogs.com/vectorx/category/2033604.html)\n- :link: CSDN：[Git_VectorX's Blog-CSDN博客](https://blog.csdn.net/qq_35925558/category_11368762.html)\n- :link: 掘金：[Git从入门到精通 - VectorX的专栏 - 掘金 (juejin.cn)](https://juejin.cn/column/7009597655873486855)\n\n\u003cmark\u003e**整理不易，还望各位看官一键三连 :heart: :heart: :heart: **\u003c/mark\u003e\n\n\u003cmark\u003e**整理不易，还望各位看官一键三连 :heart: :heart: :heart: **\u003c/mark\u003e\n\n\u003cmark\u003e**整理不易，还望各位看官一键三连 :heart: :heart: :heart: **\u003c/mark\u003e\n\n:sparkles:下面开始吧~\n\n---\n\n\n\n## 官网及下载地址\n\n- :link: Git官网：[http://git-scm.com/](http://git-scm.com/)\n- :link: GitHub官网：[https://github.com/](https://github.com/)\n- :link: Gitee官网：[https://gitee.com/](https://gitee.com/)\n- :link: GitLab官网：[https://gitlab.com/](https://gitlab.com/)\n- :link: GitLab首页：[https://about.gitlab.com/](https://about.gitlab.com/)\n- :link: Git 快速下载地址：[https://npm.taobao.org/mirrors/git-for-windows/](https://npm.taobao.org/mirrors/git-for-windows/)\n- :link: GitLab安装说明：[https://about.gitlab.com/installation/](https://about.gitlab.com/installation/)\n- :link: GitLab安装包：[https://packages.gitlab.com/gitlab](https://packages.gitlab.com/gitlab)\n- :link: GitLab源码地址：[https://gitlab.com/gitlab-org/gitlab](https://gitlab.com/gitlab-org/gitlab)\n\n\n\n## Git 基本语法\n\n### 1、Git 初始化配置\n\n```bash\ngit --version  \t\t\t\t\t      #Git版本\ngit update-git-for-windows\t\t       #升级版本\ngit config --system [--unset] user.name 用户名    #设置/删除用户签名（全局）\ngit config --system [--unset] user.email 邮箱     #设置/删除用户签名（全局） \ngit config --global [--unset] user.name 用户名    #设置/删除用户签名（用户）\ngit config --global [--unset] user.email 邮箱     #设置/删除用户签名（用户）\ngit config [--unset] user.name 用户名             #设置/删除用户签名（项目）\ngit config [--unset] user.email 邮箱              #设置/删除用户签名（项目）   \ngit config --unset credential.helper              #重置凭证\ngit config --system gui.encoding utf-8             #编码设置（全局）\ngit config --system i18n.commitEncoding utf-8      #编码设置（全局）\ngit config --system i18n.logoutputencoding utf-8   #编码设置（全局）\ngit config --global gui.encoding utf-8             #编码设置（用户）\ngit config --global i18n.commitEncoding utf-8      #编码设置（用户）\ngit config --global i18n.logoutputencoding utf-8   #编码设置（用户）\ngit config gui.encoding utf-8                      #编码设置（项目）\ngit config i18n.commitEncoding utf-8               #编码设置（项目）\ngit config i18n.logoutputencoding utf-8            #编码设置（项目）\ngit config --system alias.别名 命令参数  #设置命令别名（全局）\ngit config --global alias.别名 命令参数  #设置命令别名（用户）\ngit config alias.别名 命令参数           #设置命令别名（项目） \ngit config --system --list              #查看所有配置（全局）\ngit config --global --list              #查看所有配置（用户）\ngit config --list                       #查看所有配置（项目）\ngit init                                #初始化本地库\n```\n\n### 2、Git 状态\n\n```bash\ngit status         #查看本地库状态\ngit diff           #查看那些更新还没有暂存\ngit diff --cached  #查看哪些暂存还没有提交\ngit diff --staged  #查看哪些暂存还没有提交\n```\n\n### 3、Git 基本命令\n\n```bash\ngit add 文件名                    #添加至暂存区\ngit commit [文件名]               #提交至本地库\ngit commit -m \"日志信息\" [文件名]\ngit commit -a\ngit commit -a -m \"日志信息\"\ngit reset --soft commithash      #HEAD\ngit reset [--mixed] commithash   #HEAD、暂存区\ngit reset --hard commithash      #HEAD、暂存区、工作区（版本穿梭）\n```\n\n### 4、Git 历史记录\n\n```bash\ngit reflog                                 #引用日志\ngit log -g                                 #引用日志（详细）\ngit log                                    #详细日志\ngit log --pretty=oneline                   #一行化\ngit log --oneline                          #一行化并精简hash\ngit log --oneline --decorate               #查看当前分支所指对象\ngit log --oneline --decorate --graph --all #查看所有分支历史\n```\n\n### 5、Git 分支操作\n\n```bash\ngit branch 分支名 [commithash]  #创建分支\ngit branch [-v]                 #查看分支\ngit checkout [-b] 分支名        #[创建并]切换分支\ngit merge 分支名                #合并分支\ngit branch -D/-d name          #(强制)删除分支\n```\n\n### 6、Git 撤回与重置\n\n```bash\ngit checkout -- file           #撤回修改\ngit reset [--mixed HEAD] file  #撤回暂存\ngit commit --amend             #撤回提交\ngit reset --soft commithash     #重置HEAD\ngit reset [--mixed] commithash  #重置HEAD、暂存区\ngit reset --hard commithash     #重置HEAD、暂存区、工作区\n```\n\n### 7、Git 远程操作\n\n```bash\ngit remote add 别名 远程地址             #定义别名\ngit remote set-url --add 别名 远程地址   #同一别名添加多个远程地址\ngit remote -v                           #查看所有别名\ngit clone 远程地址                       #克隆仓库\ngit pull 别名 分支名                     #拉取分支\ngit push 别名 分支名                     #推送分支\ngit branch -vv                          #查看所有远程跟踪分支\ngit branch -u 远程跟踪分支名              #本地分支跟踪远程分支\ngit checkout -b 本地分支名 远程跟踪分支名  #创建本地分支并跟踪远程分支\ngit checkout --track 远程跟踪分支名       #创建本地分支并跟踪远程分支\n```\n\n### 8、其他命令\n\n```bash\ngit rm 文件名               #移除文件并暂存\ngit mv 原文件名 新文件名     #重命名文件并暂存\ngit stash  \t\t\t\t  #命令会将未完成的修改保存到一个栈上，而你可以在任何时候重新应用这些改动(git stash apply) \ngit stash list             #查看存储\ngit stash apply stash@{2}  #如果不指定一个储藏，Git认为指定的是最近的储藏\ngit stash drop             #加上将要移除的储藏的名字来移除它\ngit stash pop              #来应用储藏然后立即从栈上扔掉它\nssh-keygen -t rsa [-C 描述]   #SSH免密登录生成密钥\nssh -T git@github.com         #测试配置是否成功\n```\n\n\n\n整理难免有误，欢迎大家批评指正！\n\n---\n\n\u003e 署名 4.0 国际 (CC BY 4.0)。您可以自由地：共享 — 在任何媒介以任何形式复制、发行本作品；演绎 — 修改、转换或以本作品为基础进行创作；在任何用途下，甚至商业目的。只要你遵守许可协议条款，许可人就无法收回你的这些权利。惟须遵守下列条件：署名 — 您必须给出适当的署名，提供指向本许可协议的链接，同时标明是否（对原始作品）作了修改。您可以用任何合理的方式来署名，但是不得以任何方式暗示许可人为您或您的使用背书。\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectorxxxx%2Fnote_git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvectorxxxx%2Fnote_git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvectorxxxx%2Fnote_git/lists"}