1. 进入git项目根目录

  2. 设置对比工具

    git config --global diff.tool vscode
    git config --global difftool.vscode.cmd "code --wait --diff \$LOCAL \$REMOTE"
    git config --global difftool.prompt false
    
  3. git difftool --no-prompt <旧commit> <新commit> -- <文件相对路径>

  • 路径必须用「相对仓库根目录」的路径
Last Updated:
Contributors: haizhiguang