我正在尝试添加Git签到作为我的MSBuild脚本的一部分。我想:
构建脚本位于./Build/(其中。是解决方案文件夹)。
我正在使用:
<Target Name="Committed" DependsOnTargets="SignedInstaller">
<Exec Command=""$(GitInstallationFolderPath)cmd\git.exe" --git-dir=..\.git --work-tree=.. commit -m "$(Changes)""/>
<Exec Command=""$(GitInstallationFolderPath)cmd\git.exe" --git-dir=..\.git --work-tree=.. push"/>
<Exec Command=""$(GitInstallationFolderPath)cmd\git.exe" --git-dir=..\.git --work-tree=.. tag -a v$(VersionNumber) -m "$(Changes)""/>
<Exec Command=""$(GitInstallationFolderPath)cmd\git.exe" --git-dir=..\.git --work-tree=.. push -- tags"/>
</Target>
自定义属性都可以。
第一次提交以1退出并打破构建。
我不确定我是否只需要调整一下,或者如果我认为这一切都错了,那么欢迎提出建议。我需要做一些向Git添加任何新文件 - 还没有那么远。我确实想坚持使用MSBuild,因为我们现在有很多脚本。我只想删除我的SVN目标并转移到Git。
答案 0 :(得分:1)
与MSBuild Extensions中的GitTasks的有限功能不同,Community Tasks中似乎有更多通用内容。
GitBranch A task to get the name of the branch or tag of git repository
GitClient A task for Git commands.
GitCommits A task for git to retrieve the number of commits on a revision.
GitDescribe A task for git to get the most current tag, commit count since tag, and commit hash.
GitPendingChanges A task for git to detect if there are pending changes
GitVersion A task for git to get the current commit hash.