Skip to content

git_查看命令 #5

@lastorder

Description

@lastorder

git reflog #查看历史操作记录

git log --pretty=oneline #按一行显示
git log --graph 命令可以看到分支合并图。

git log --pretty=oneline <branch 1>..<branch 2> 显示分支2比公共分支多的commit
git log --pretty=oneline ..<branch 2> 显示分支2比公共分支多的commit
git log --pretty=oneline <branch 1>.. 显示当前分支比公共分支多的commit
git log --pretty=oneline <branch 1>...<branch 2> --left-right 三个点,'<'表示分支1的提交,'>'表示分支2的提交

git status 查询git修改状态

git diff 查看文件修改

--stat 参数,显示概要统计

git diff 工作区 VS 暂存区,查询工作目录的文件修改状态(不包括已经add的记录)
git diff --cached 暂存区 VS HEAD
git diff (commit) 工作区 VS commit
git diff <--cached> 查询暂存区与指定commit(指定文件的修改记录)
git diff 两个commit之间的差异

git diff 工作区 VS 指定分支
git diff 新分支 VS 老分支
git diff .. 两个点,新分支 VS 老分支
git diff ... 三个点,新分支 VS 两个分支的公共节点

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions