You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在VSTS的GIT提交列表中查看完整提交消息?

解决Azure DevOps(原VSTS)Git提交列表显示完整消息的办法

嘿,这个问题我之前也纠结过!明明提交了多行消息,结果列表里只显示第一行,悬停看完整实在太麻烦,折腾了一阵终于找到几个可行的方案:

1. 网页端直接改内置设置

这是最省心的办法,Azure DevOps其实自带了这个选项,只是藏得有点深:

  • 打开你的Git仓库,切换到Commits标签页
  • 点击页面右上角的齿轮图标(Settings)
  • 在弹出的面板里找到Commit message display,把默认的First line only改成Full message
  • 保存后刷新页面,就能看到所有提交的完整消息直接展示在列表里了

2. 内置设置找不到?用浏览器脚本强制展开

如果你的Azure DevOps版本比较旧,或者权限问题看不到上面的设置,那就用Tampermonkey这类用户脚本工具来搞定:

  • 先装个Tampermonkey(Chrome、Firefox都支持)
  • 新建一个用户脚本,把下面的代码粘进去:
// ==UserScript==
// @name         Azure DevOps Full Commit Messages
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  强制显示Azure DevOps提交列表的完整消息
// @author       自定义名字
// @match        https://*.visualstudio.com/*/_git/*/commits*
// @match        https://dev.azure.com/*/_git/*/commits*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // 移除消息高度限制,允许换行
    document.querySelectorAll('.commit-message').forEach(el => {
        el.style.maxHeight = 'none';
        el.style.whiteSpace = 'pre-wrap';
    });
    // 监听滚动加载的新提交,自动处理样式
    const observer = new MutationObserver((mutations) => {
        mutations.forEach(mutation => {
            if (mutation.addedNodes.length) {
                document.querySelectorAll('.commit-message').forEach(el => {
                    el.style.maxHeight = 'none';
                    el.style.whiteSpace = 'pre-wrap';
                });
            }
        });
    });
    observer.observe(document.querySelector('.commits-list'), { childList: true, subtree: true });
})();
  • 保存脚本后刷新提交页面,所有提交消息就会自动展开显示完整内容了

3. 用CLI命令导出完整日志

要是你习惯用命令行,也可以用Azure DevOps CLI来获取完整的提交日志,还能导出成表格:

  • 先装CLI扩展:az extension add --name azure-devops
  • 登录账号并配置默认组织和项目:
    az login
    az devops configure --defaults organization=https://dev.azure.com/你的组织名 project=你的项目名
    
  • 执行命令获取完整日志:
    az git commit list --repository 你的仓库名 --output table --query "[].{提交ID:commitId, 完整消息:comment}"
    
    这个命令会把每个提交的ID和完整消息清晰地列出来,还能复制导出成文件

内容的提问来源于stack exchange,提问作者user310988

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 06:36:48