title: Check If Local Branch Exists On Remote Git
body: <p>I would like to see if one of my newly created local branches exists on the remote with a one line command. Like making an alias or function that would allow me to type </p>
  
  <pre><code>git remoteExists &lt;branchName&gt;
  </code></pre>
  
  <p>Right now I manually list off every branch on the remote and check to see if my local branch is there. This is not as easy as I would like since our remote has hundreds of branches, many with similar names. </p>
  
  <p>I'm switching branches often working on different things, maybe 6-7 at a time, and it's difficult to remember if I've completed and pushed a branch or if I still need to finish it up. </p>
  
  <p>I've searched and found some ways to do things similar to this, but many seemed unnecessarily complicated, is there a simpler way to do this?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>To be clear on what I'm doing. I'm starting from a remote branch and making a local branch off that. I'm making changes to my local branch and pushing. I do not want to set an upstream branch, since I will not be using this branch again; the person handling the remote branch will look at my changes and integrate them into the remote version. </p>
  
  <p>This works:</p>
  
  <pre><code>git diff &lt;branchName&gt; remotes/origin/&lt;branchName&gt;
  </code></pre>
  
  <p>fatal: ambiguous argument 'remotes/origin/TestReadyBranch': unknown revision or path not in the working tree.
  Use '--' to separate paths from revisions, like this:
  'git  [...] -- [...]'</p>
  
  <p>Upon seeing this error I would know that the branch doesn't exist on the remote. Is there a cleaner way to do this?</p>