title: How to get the output of git diff command in Shell Script
body: <p>I am trying to perform Git diff in two branches with the same file. I want to get the difference of two files.</p>
  
  <ul>
  <li>If there is a fatal error</li>
  <li>If there is a difference/ not matched</li>
  <li>If there is NO difference/ matched</li>
  </ul>
  
  <p>I tried saving the command in a variable to get the result. Example: GIT_DIFF=$(git diff RB_202005:/test.txt RB_202006:/test.txt) and then printing the variable (Example: echo $GIT_DIFF) but nothing is being returned.</p>