git - 识别推送中所做的所有提交

标签 git teamcity

我正在配置 TeamCity 服务器,我需要知道如何识别单次推送中提交的所有文件。

例如:

  • 用户提交 1:
    • 文件1.c
    • 文件2.c
  • 用户提交2:
    • 文件1.c
    • 文件X.c
    • 文件Y.c

我需要对所有这些文件进行分组,以便为​​这个“push”命令构建 1 个版本。有一个 git 命令可以做到这一点吗?

谢谢。

最佳答案

您可以显示 git 日志并使用结果:

列出最后一次提交:

git log --name-status -p -1

result: 
commit d1bc9d55024e4e3e6acc087ba223bd7951b555fa
            Author: unknown <johndoe>
            Date:   Wed Oct 7 16:20:27 2015 -0300

                           task1000 commit message here...

            M           file1.c
            M           file2.c

现在,列出消息中带有“task1000”的所有提交:

git log --name-status --grep="task1000"

result:
            commit d1bc9d55024e4e3e6acc087ba223bd7951b555fa
            Author: unknown <johndoe>
            Date:   Wed Oct 7 16:20:27 2015 -0300

                           task1000 commit message here...

            M           file1.c
            M           file2.c

            commit 998a74eaa752f6c98c32ec9a412b219afb7cc891
            Author: unknown <johndoe>
            Date:   Wed Oct 7 16:19:56 2015 -0300

                           task1000 more one commit for this task..

            M           file1.c
            M           fileX.c
            M           fileY.c

现在您必须处理这个结果。

您需要监视服务器中的每个提交。

关于git - 识别推送中所做的所有提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32997818/

相关文章:

git - 通过 SSL 使用我自己的 GIT 服务器设置 TeamCity

git - 挤进master后提交历史困惑

git - 在 Visual Studio 中从 Git 中删除文件

teamcity - 为什么使用 BullsEye 编译器编译项目?

TeamCity:按计划禁用触发器

visual-studio-2010 - 用于与 Visual Studio 2010 解决方案/项目持续集成的 TeamCity

git - Jenkins (Windows) Git fetch 非常慢

git - 我可以将 git commit 电子邮件发送给多个收件人吗?

git - 重命名 git 裸存储库中的分支

tomcat - 从我的域的任何 HTTP url HTTPS 重定向