一、配置操作
二、本地操作
三、分支操作
四、变更历史
五、标签操作
六、远端交互
git config --global user.name '你的名字'
git config --global user.email '你的邮箱'
12git config --local user.name '你的名字'
git config --local user.email '你的邮箱' git config --global --list git config --local --list git config --unset --global 要删除的配置项 git config --unset --local 要删除的配置项 git status git add . git add -A git add 文件1 文件2 文件3 git diff git diff 文件 git diff --cached git diff --cached 文件 git diff HEAD 文件git commit git checkout 文件1 文件2 文件3 git reset 文件1 文件2 文件3 git reset --hard git difftool 提交1 提交2 git ls-files --others git stashgit stash pop
git stash applygit stash list git stash pop stash@{数字n}git add.
git commit --amend git branch -v git branch -av git branch -rv git checkout 指定分支git branch 新分支 git branch 新分支 指定分支 git branch 新分支 某个 commit 的 id git checkout -b 新分支 git branch -d 要删除的分支 git branch -D 要删除的分支 git branch --merged master | grep -v '^\*\| master' | xargs -n 1 git branch -d git remote prune origngit merge A分支git merge A分支 B分支 git rebase B分支 git rebase B分支 A分支 git log --onelinegit log -n git log --oneline --graph --allgit log 文件 git blame 文件 git tag git tag v1.0 git tag -a v1.0 -m '前端食堂' git tag v1.0 commitid git push origin v1.0 git push origin --tags git tag -d v1.0 git push origin :refs/tags/v1.0 git remote -v git remote add url git remote remove remote的名称 git remote rename 旧名称 新名称 git fetch remotegit pull origin 分支名git push origin 分支名git push remote --delete 远端分支名
git push remote :远端分支名