Answers: <p>When <code>git</code> is installed it usually doesn't add the <code>diff</code> executable to the path because it would conflict with other versions of <code>diff</code> native to Windows, for example, the <code>Compare-Object</code> alias in PowerShell.</p>
  
  <ol>
  <li><p>You can usually get around this by adding <code>C:\Program Files\Git\usr\</code> to the path which contains all of the UNIX ports of functionality such <code>diff</code>, <code>grep</code>, <code>awk</code>, <code>sed</code>.  You do have to be careful as some commands are used more commonly on Windows than others, the most common one is <code>find</code>.</p></li>
  <li><p>A second option would be to fully qualify the call to <code>diff</code> by appending <code>C:\Program Files\Git\usr\bin</code>.</p></li>
  </ol>
  
Answers: CC BY-SA 4.0
Answers: 2019-10-21T11:26:58.337Z
Answers: 2019-10-21T11:26:58.337Z
Answers: Richard Slater
Body: <p>Attempt was <code>choco install git -y</code>, but it does not seem to be available:</p>
  
  <pre><code>The command "diff -u &lt;(echo -n) &lt;(gofmt -d ./)" exited with 2.
  diff: /dev/fd/62: No such file or directory
  </code></pre>
  
  <p><a href="https://travis-ci.org/030/go-multipart/jobs/600458560" rel="nofollow noreferrer">Windows Travis Build</a></p>
  
Tags: <windows><travis-ci>
Title: How to get 'diff' on Windows TravisCI machines?
UserDisplayName: 030
ThreadText: # How to get 'diff' on Windows TravisCI machines?
  
  (Asked by: username_0 on 2019-10-20)
  
  Attempt was `choco install git -y`, but it does not seem to be available:
  
  ```
  The command "diff -u <(echo -n) <(gofmt -d ./)" exited with 2.
  diff: /dev/fd/62: No such file or directory
  
  ```
  
  [Windows Travis Build](https://travis-ci.org/030/go-multipart/jobs/600458560)
  
  **Tags:** windows, travis-ci
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-10-21. Score: 2 | Accepted answer
  
  When `git` is installed it usually doesn't add the `diff` executable to the path because it would conflict with other versions of `diff` native to Windows, for example, the `Compare-Object` alias in PowerShell.
  
  1. You can usually get around this by adding `C:\Program Files\Git\usr\` to the path which contains all of the UNIX ports of functionality such `diff`, `grep`, `awk`, `sed`. You do have to be careful as some commands are used more commonly on Windows than others, the most common one is `find`.
  2. A second option would be to fully qualify the call to `diff` by appending `C:\Program Files\Git\usr\bin`.
  
  
  ---
  
  