是否有任何自动方法来验证Git仓库中的所有提交是否处于可编译状态?
我需要这个来验证我在重写历史后没有破坏任何东西.由于我正在重写历史记录,因此排除了构建服务器 - 在重写历史记录后,提交时提交的提交可能会被破坏.
例如,我有一个Visual Studio 2015 C#项目,我想象一些脚本如:
git filter-branch --tree-filter msbuild
Run Code Online (Sandbox Code Playgroud)
我希望它在每次提交时运行构建,并在构建过程返回非零时停止并显示错误消息.
考虑到树过滤器将从Git bash执行命令,您可能想要使用
git filter-branch --tree-filter "MSBuild.exe"
Run Code Online (Sandbox Code Playgroud)
(确保你%PATH%确实包含c:\Program Files (x86)\MSBuild\14.0\Bin)
(或使用正斜杠,如此处所示)
git rebase -i --exec MSBuild.exe <first sha you want to test>~
Run Code Online (Sandbox Code Playgroud)
您可以使用类似这样的主旨CMD会话,从蒂姆·阿贝尔:
@echo off
REM batch script for loading git-bash and the vs tools in the same window
REM inspiration: http://www.drrandom.org/post/2011/11/16/Grappling-with-multiple-remotes-in-git-tfs.aspx
REM screenshot: https://twitter.com/#!/tim_abell/status/199474387731226624/photo/1
%HOMEDRIVE%
cd %HOMEPATH%
call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
echo Use full exe names when running under bash, e.g. "msbuild.exe"
echo Loading bash, you may now use git and msbuild in the same console \o/.
"C:\Program Files (x86)\Git\bin\sh.exe" --login -i
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
458 次 |
| 最近记录: |