克隆生成回购时,如何让TeamCity创建.git目录? [英] How do I get TeamCity to create the .git directory when cloning a repo for build?

查看:178
本文介绍了克隆生成回购时,如何让TeamCity创建.git目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在MSBuild文件中运行自定义命令;它基本上运行'git log -10'并将提交信息存储到一个文本文件中。

I'm trying to run a custom command in my MSBuild file; it basically runs 'git log -10' and stores that commit info into a text file.

问题是,当我尝试运行构建时,它的错误说致命的:不是一个混帐存储库。所以我检查了TeamCity的项目工作目录,没有.git目录!

The problem is, when I try to run the build, it errors saying "fatal: Not a git repository". So I checked TeamCity's work directory for my project, and there is no .git directory!

为什么TeamCity在克隆版本库时不创建.git目录?有没有一种方法来启用它?

Why doesn't TeamCity create the .git directory when it clones the repository? Is there a way to enable this?

编辑:TeamCity版本是7.1.2;我会尝试更新到8.0.1以查看是否有可用的选项。

edit: TeamCity version is 7.1.2; I'll try updating to 8.0.1 to see if there is an option available for this.

推荐答案

我更改了VCS结帐模式从服务器自动在代理,它现在的作品!感谢这个问题的答案:在TeamCity构建步骤中使用git命令

I changed the VCS checkout mode from server to "automatically on agent" and it works now! Thanks to the answer for this question: Using git commands in a TeamCity Build Step.

这篇关于克隆生成回购时,如何让TeamCity创建.git目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆