title: How to use git lfs with Visual Studio Team Services hosted build agents
body: <p>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:</p>
  
  <pre><code>&amp; git lfs fetch
  </code></pre>
  
  <p>Unfortunately, my build fails with the following error:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Since I can't install anything on hosted agents, how am I supposed to have git lfs available?</p>
  
  <p><strong>EDIT</strong>
  In this issue, I am not talking about git lfs authentication problems as described <a href="https://stackoverflow.com/questions/34083386/check-out-git-lfs-files-on-vstf-build/35876342">here</a>. I am strictly talking about the issue of calling <code>git lfs</code>.</p>
  
  <p>Once you are able to call <code>git lfs</code>, look at this <a href="https://stackoverflow.com/a/35876342/2679757">answer</a> to solve the authentication problem.</p>