Linux command
hg-commit 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Commit all changes
hg commit -m "[message]"
Commit specific files
hg commit [file1] [file2] -m "[message]"
Commit with editor for message
hg commit
Amend the last commit
hg commit --amend
Close a branch
hg commit --close-branch -m "[message]"
说明
hg commit saves changes to the repository as a new changeset. With no files specified, all modified files are committed. Use -m for inline message or omit it to open an editor. The --amend flag modifies the parent commit instead of creating a new one.
参数
- -m, --message _text_
- Commit message.
- -A, --addremove
- Add/remove files before committing.
- --amend
- Amend the parent changeset.
- -u, --user _user_
- Record user as committer.
- -d, --date _date_
- Record date as commit date.
- --close-branch
- Mark branch as closed.
FAQ
What is the hg-commit command used for?
hg commit saves changes to the repository as a new changeset. With no files specified, all modified files are committed. Use -m for inline message or omit it to open an editor. The --amend flag modifies the parent commit instead of creating a new one.
How do I run a basic hg-commit example?
Run `hg commit -m "[message]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -m, --message _text_ do in hg-commit?
Commit message.