How do I get TeamCity to create the .git directory when cloning a repo for build?

假如想象 提交于 2019-12-20 11:03:51

问题


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.

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!

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

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.


回答1:


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.




回答2:


It is documented as VCS Checkout Mode: https://confluence.jetbrains.com/display/TCD9/VCS+Checkout+Mode

TeamCity version is 9.x



来源:https://stackoverflow.com/questions/17555931/how-do-i-get-teamcity-to-create-the-git-directory-when-cloning-a-repo-for-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!