DevOps - Git - 信息查看

git help

git version  # Display the version of git.

git help  # Prints the synopsis and a list of the most commonly used commands.
git help git  # Display the git man page.

git <COMMAND> -h  # Display the brief help.
git help <COMMAND/CONCEPT>  # Display help for specific subcommand or concept. "git  <COMMAND/CONCEPT> --help"

git help --help  # Display the help of 'git help'.
git help --all  # Print all available commands on the standard output.
git help --guide  # Print a list of the useful Git guides on the standard output.

git config

git config --list  # 显示所有配置信息
git config --global --list  # 显示全局配置信息
git config --local --list  # 显示local repository配置信息(在local repository目录下执行)

git remote

git remote  # 查看remote repository信息
git remote -v  # 查看remote repository详细信息。如果没有推送权限,就看不到remote repository的地址

git status

git status  # Show the working tree status. 
git status --short  # Give the output in the short-format.

git log

git log  # 查看commit日志
git log <file>  # 查看某个文件的commit日志
git log -3  # 查看最近3次的commit日志


git log -p  # 补丁格式显示每个提交之间的具体差异
git log --stat  # 显示每个提交的文件修改统计信息

git log --oneline  # 逐条简洁显示commit日志
git log --oneline --graph  # 图形化显示分支合并历史
git log --oneline --graph --decorate  # 图形化显示分支合并历史,包含commit的引用信息

git log --merges  # 只显示merge commit日志
git log --no-merges  # 显示过滤merge commit之后的git log

git log --author=<author name>  # 搜索指定作者的提交历史
git log --grep=<pattern>  # 搜索commit描述匹配<pattern>的commit.
git log --after="2016-12-1" --before="2017-1-1"  # 显示某个时间段的commit日志

git shortlog

git shortlog  # Summarize 'git log' output order by the author
git shortlog --summary  # Suppress commit description and provide a commit count summary only.
git shortlog --numbered  # Sort output according to the number of commits per author instead of author alphabetic order.
git shortlog --email  # Show the email address of each author.

git reflog

git reflog  # 显示命令日志

git show

git show  # 查看上一次commit的内容:
git show <commit id>  # 查看某次commit的内容
git show <commit>:<filename>  # 显示某次提交时,某个文件的内容

git diff

git diff  # 显示暂存区和工作区的差异
git diff HEAD  # 显示工作区与当前分支最新commit之间的差异
git diff <commit-id-1>..<commit-id-2>  # 查看commit之间的对比
git diff <branch-name-1> <branch-name-2>  # 查看branch之间的对比

git blame

git blame <file>  # Show what revision and author last modified each line of a file.

转载于:https://www.cnblogs.com/anliven/p/6354590.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值