To produce the difference between the tips of the two branches.
git diff <branch_1>..<branch_2>
To find the difference from their common ancestor to test, you can use three dots instead of two:
git diff <branch_1>...<branch_2>
For more information regarding git and version controlling tools please go through the following tutorial that helps.