title: How to remove a remote reference in Git?
body: <p>I am having a "weird" issue probably because I did something wrong or forgot to do something else but now each time I run the following command:</p>
  
  <pre><code>git checkout master &amp;&amp; git pull origin master &amp;&amp; git fetch -p
  </code></pre>
  
  <p>I got the following error:</p>
  
  <pre><code>Already on 'master'
  From ssh://reponame
   * branch                  master     -&gt; FETCH_HEAD
  Already up to date.
  fatal: Couldn't find remote ref refs/heads/global/CDP-5353_fix
  </code></pre>
  
  <p>I have tried the following (that I got from <a href="https://stackoverflow.com/questions/3046436/how-do-you-stop-tracking-a-remote-branch-in-git">here</a>):</p>
  
  <pre><code>E:\repo (master -&gt; origin)
  λ git branch -r | grep CDP-5353_fix
  
  E:\repo (master -&gt; origin)
  λ git branch | grep CDP-5353_fix
  </code></pre>
  
  <p>Branch <code>CDP-5353_fix</code> does not exists locally and/or remote.</p>
  
  <pre><code>E:\repo (master -&gt; origin)
  λ git branch --unset-upstream
  
  E:\repo (master -&gt; origin)
  λ git checkout master &amp;&amp; git pull origin master &amp;&amp; git fetch -p
  Already on 'master'
  From ssh://reponame
   * branch                  master     -&gt; FETCH_HEAD
  Already up to date.
  fatal: Couldn't find remote ref refs/heads/global/CDP-5353_fix
  </code></pre>
  
  <p>Same issue ...</p>
  
  <pre><code>E:\repo (master -&gt; origin)
  λ git branch -d -r origin CDP-5353_fix
  error: remote-tracking branch 'origin' not found.
  error: remote-tracking branch 'CDP-5353_fix' not found.
  
  E:\repo (master -&gt; origin)
  λ git config --unset branch.CDP-5353_fix.remote
  
  E:\repo (master -&gt; origin)
  λ git config --unset branch.CDP-5353_fix.merge
  
  E:\repo (master -&gt; origin)
  λ git checkout master &amp;&amp; git pull origin master &amp;&amp; git fetch -p
  Already on 'master'
  From ssh://reponame
   * branch                  master     -&gt; FETCH_HEAD
  Already up to date.
  fatal: Couldn't find remote ref refs/heads/global/CDP-5353_fix
  </code></pre>
  
  <p>Same issue ...</p>
  
  <p>What I am missing here? The message is not messing up with my repo or anything on it but it is annoying. Any help?</p>
  
  <p><strong>UPDATE 1:</strong></p>
  
  <p>Output of <code>git remote -v</code>:</p>
  
  <pre><code>λ git remote -v                                           
  origin  ssh://reponame (fetch) 
  origin  ssh://reponame (push)  
  </code></pre>
  
  <blockquote>
    <p><strong>Note:</strong> I am hiding the real repo name because it belongs to the company
    I work for and they don't like to share that kind of stuff.</p>
  </blockquote>
  
  <p><strong>UPDATE 2:</strong></p>
  
  <p>Output of <code>git config --get-all remote.origin.fetch</code>:</p>
  
  <pre><code>λ git config --get-all remote.origin.fetch
  +refs/heads/*:refs/remotes/origin/*
  +refs/heads/CDP-5288:refs/remotes/origin/CDP-5288
  +refs/heads/CDP-5299:refs/remotes/origin/CDP-5299
  +refs/heads/global/CDP-5353_fix:refs/remotes/origin/global/CDP-5353_fix
  ...
  </code></pre>