git config --system alias.{short name} {origin name}: 配置命令别名git config --get-regexp alias: 列出所有别名配置git diff --check: 查看是否有冲突或者空行的修改
- 轻量级标签
git tag {tagname} - 含附注标签
git tag -a {tagname} -m {annotation} - 推送分支
git push origin {tagname} - 推送所有分支
git push origin --tags
- 重命名任何一个分支:
git branch -m {oldname} {newname} - 重命名当前分支:
git branch -m {newname} - 列出已经合并的分支:
git branch --merged
- 从仓库中以及从文件系统中删除文件:
git rm {file name} - 仅从仓库中删除文件:
git rm --cached {file name}
- 删除已合并的分支:
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d - 搜索日志:
git log --grep=<pattern>,相关:git log --all-match,git log --grep-reflog=<pattern>
- 列出所有别名:
git config --get-regexp alias - 列出配置目录:
git config --list --show-origin
git status乱码git config --global core.quotepath false