Linux command
git-mergetool 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run merge tool
git mergetool
Use specific tool
git mergetool --tool=[vimdiff]
Resolve specific file
git mergetool [file.txt]
Don't prompt
git mergetool --no-prompt
Use configured tool
git mergetool -y
说明
git mergetool runs a visual merge conflict resolution tool for each conflicted file. It launches configured tools like vimdiff, meld, or kdiff3, providing a three-way merge interface showing the base, local, and remote versions side by side. After saving the merged result in the tool, the file is marked as resolved. Multiple conflicted files are processed sequentially, and you can choose to skip individual files.
参数
- --tool _TOOL_
- Use specified merge tool.
- --tool-help
- List available tools.
- -y, --no-prompt
- Don't prompt before each file.
- --prompt
- Prompt before each file.
- --help
- Display help information.
FAQ
What is the git-mergetool command used for?
git mergetool runs a visual merge conflict resolution tool for each conflicted file. It launches configured tools like vimdiff, meld, or kdiff3, providing a three-way merge interface showing the base, local, and remote versions side by side. After saving the merged result in the tool, the file is marked as resolved. Multiple conflicted files are processed sequentially, and you can choose to skip individual files.
How do I run a basic git-mergetool example?
Run `git mergetool` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --tool _TOOL_ do in git-mergetool?
Use specified merge tool.