NOTE_Git
介绍
:sparkles: 尚硅谷5h打通Git全套教程IDEA版(涵盖GitHub Gitee码云 GitLab)/ 尚硅谷Git教程全套完整版(12h深入掌握git)
更新
**整理不易,还望各位看官一键三连 :heart: :heart: :heart: **
**整理不易,还望各位看官一键三连 :heart: :heart: :heart: **
**整理不易,还望各位看官一键三连 :heart: :heart: :heart: **
:sparkles:下面开始吧~
官网及下载地址
Git 基本语法
1、Git 初始化配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| git --version git update-git-for-windows git config --system [--unset] user.name 用户名 git config --system [--unset] user.email 邮箱 git config --global [--unset] user.name 用户名 git config --global [--unset] user.email 邮箱 git config [--unset] user.name 用户名 git config [--unset] user.email 邮箱 git config --unset credential.helper git config --system gui.encoding utf-8 git config --system i18n.commitEncoding utf-8 git config --system i18n.logoutputencoding utf-8 git config --global gui.encoding utf-8 git config --global i18n.commitEncoding utf-8 git config --global i18n.logoutputencoding utf-8 git config gui.encoding utf-8 git config i18n.commitEncoding utf-8 git config i18n.logoutputencoding utf-8 git config --system alias.别名 命令参数 git config --global alias.别名 命令参数 git config alias.别名 命令参数 git config --system --list git config --global --list git config --list git init
|
2、Git 状态
1 2 3 4
| git status git diff git diff --cached git diff --staged
|
3、Git 基本命令
1 2 3 4 5 6 7 8
| git add 文件名 git commit [文件名] git commit -m "日志信息" [文件名] git commit -a git commit -a -m "日志信息" git reset --soft commithash git reset [--mixed] commithash git reset --hard commithash
|
4、Git 历史记录
1 2 3 4 5 6 7
| git reflog git log -g git log git log --pretty=oneline git log --oneline git log --oneline --decorate git log --oneline --decorate --graph --all
|
5、Git 分支操作
1 2 3 4 5
| git branch 分支名 [commithash] git branch [-v] git checkout [-b] 分支名 git merge 分支名 git branch -D/-d name
|
6、Git 撤回与重置
1 2 3 4 5 6
| git checkout -- file git reset [--mixed HEAD] file git commit --amend git reset --soft commithash git reset [--mixed] commithash git reset --hard commithash
|
7、Git 远程操作
1 2 3 4 5 6 7 8 9 10
| git remote add 别名 远程地址 git remote set-url --add 别名 远程地址 git remote -v git clone 远程地址 git pull 别名 分支名 git push 别名 分支名 git branch -vv git branch -u 远程跟踪分支名 git checkout -b 本地分支名 远程跟踪分支名 git checkout --track 远程跟踪分支名
|
8、其他命令
1 2 3 4 5 6 7 8 9
| git rm 文件名 git mv 原文件名 新文件名 git stash git stash list git stash apply stash@{2} git stash drop git stash pop ssh-keygen -t rsa [-C 描述] ssh -T git@github.com
|
整理难免有误,欢迎大家批评指正!
署名 4.0 国际 (CC BY 4.0)。您可以自由地:共享 — 在任何媒介以任何形式复制、发行本作品;演绎 — 修改、转换或以本作品为基础进行创作;在任何用途下,甚至商业目的。只要你遵守许可协议条款,许可人就无法收回你的这些权利。惟须遵守下列条件:署名 — 您必须给出适当的署名,提供指向本许可协议的链接,同时标明是否(对原始作品)作了修改。您可以用任何合理的方式来署名,但是不得以任何方式暗示许可人为您或您的使用背书。