Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Improving speed of checkout from git (from github)

I'm using git and TeamCity v6.0 in a Windows environment.

I have just switched over from server side checkouts to checkout on agents because of IO issues, however...

Initial checkout has become exceeding slow from ~ a minute to >45 minutes. Once the repo is cloned everything is OK. Is there some configuration on the agents I can tweak to improve this? Thanks for any replies in advance.

What I see is the initial git files created on the agent and then there is a very long pause and then I get all my data. I can see from the process explorer that git appears to be doing very little and there is no obvious source of throttling.

like image 758
James Woolfenden Avatar asked Apr 03 '12 13:04

James Woolfenden


People also ask

How can i Improve my Git performance?

This article reveals two action tips that git users can perform that will improve git performance. Note: Github and Gitlab are using a fast-forward style for merge requests and pull requests which rely on rebase and often have squash commits and remove merged branches by default. Limit the number of commits you have in a branch.

Why is Git so slow for me?

When working with large working trees, Git's (frequent) checking whether files were modified since Git's internal index was last updated can lead to substantial lags.

Is it possible to turn off the git status check?

In such a case, it can make sense to switch off this check, but it comes at a price: it requires discipline on the developer's side to keep track which files were changed and git add them explicitly for the next commit (the output of git status will no longer identify modified files). You can disable the check per-repository thusly

What does the Git timeout parameter do?

It is particularly important to note that the git timeout parameter must be set first to prevent git from reporting a 504 (timeout) on the server side when the mirror on the server side is too long Embed gitclone.com in the original URL, such as:


1 Answers

One thing that can cause a slowdown is java ssh implementation used with agent-side checkout, to turn it off set an agent property teamcity.git.use.native.ssh=true.

Also you can set an agent property teamcity.git.use.local.mirrors=true, in this case TeamCity will create a bare clone of your repository and will update build directory from this bare clone instead of github, i.e. initial clone will be done only once.

like image 194
neverov Avatar answered Nov 14 '22 22:11

neverov