原文地址:https://blog.spiritling.cn/posts/5fddf106/
git config --global user.name '你的名字'
git config --global user.email '你的邮箱'git config --local user.name '你的名字'
git config --local user.email '你的邮箱'git config --global --listgit config --local --list复制代码git config -unset --global 要删除的配置项git config --unset --local 要删除的配置项git statusgit add .git add -Agit add 文件1 文件2 文件3git diffgit diff 文件git diff --cachedgit diff -cached 文件git diff HEAD 文件git commitgit checkout 文件1 文件2 文件3git reset 文件1 文件2 文件3git reset --hardgit difftool 提交1 提交2git ls-files --othersgit stashgit stash popgit stash applygit stash listgit stash pop stash@{数字n}git add.
git commit --amendgit branch -vgit branch -avgit branch -rvgit checkout 指定分支git branch 新分支git branch 新分支 指定分支git branch 新分支 某个 commit 的 idgit 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 -ngit log --oneline --graph --allgit log 文件git blame 文件git taggit tag v1.0git tag -a v1.0 -m '前端食堂'git tag v1.0 commitidgit push origin v1.0git push origin --tagsgit tag -d v1.0git push origin :refs/tags/v1.0git remote -vgit remote add urlgit remote remove remote的名称git remote rename 旧名称 新名称git fetch remotegit pull origin 分支名git push origin 分支名git push remote --delete 远端分支名git push remote :远端分支名