Linux command
hg-log 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Show commit history
hg log
Show last n commits
hg log -l [5]
Show specific file history
hg log [file]
Show with patch
hg log -p
Graph view
hg log -G
Show specific revision
hg log -r [revision]
Show commits by a specific user
hg log -u [username]
Show commits matching a keyword
hg log -k [keyword]
说明
hg log displays repository commit history. It shows changesets with author, date, summary, and other metadata. The command supports filtering by file, branch, or revision range. Graph mode visualizes branch and merge structure.
参数
- -l, --limit _N_
- Limit number of entries.
- -r, --rev _REV_
- Show specific revision.
- -p, --patch
- Show patches.
- -G, --graph
- Show DAG graph.
- -b, --branch _BRANCH_
- Show branch commits.
- -u, --user _USER_
- Show commits by user.
- -k, --keyword _TEXT_
- Search commit messages.
- --template _TPL_
- Output template.
- --help
- Display help information.
FAQ
What is the hg-log command used for?
hg log displays repository commit history. It shows changesets with author, date, summary, and other metadata. The command supports filtering by file, branch, or revision range. Graph mode visualizes branch and merge structure.
How do I run a basic hg-log example?
Run `hg log` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -l, --limit _N_ do in hg-log?
Limit number of entries.