Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use git lfs with Visual Studio Team Services hosted build agents

I use git lfs to store the large files of my git repo. I then try to build this repo with hosted agents. My build is pretty simple. It has a single task: Execute PowerShell. In the invoked script, the first thing that I want to do is to fetch my lfs dependencies. I therefore have the following in my script:

& git lfs fetch

Unfortunately, my build fails with the following error:

2016-03-04T19:49:05.7021988Z ##[error]git: 'lfs' is not a git command. See 'git --help'.
2016-03-04T19:49:05.7031986Z ##[error]Did you mean this?
2016-03-04T19:49:05.7041987Z ##[error]  flow

Since I can't install anything on hosted agents, how am I supposed to have git lfs available?

EDIT In this issue, I am not talking about git lfs authentication problems as described here. I am strictly talking about the issue of calling git lfs.

Once you are able to call git lfs, look at this answer to solve the authentication problem.

like image 458
mabead Avatar asked Mar 04 '16 20:03

mabead


Video Answer


1 Answers

Git LFS is now supported by default on the Hosted Build Controller. But you do need to enable it in your get sources step.

like image 162
jessehouwing Avatar answered Oct 03 '22 04:10

jessehouwing