title: How do I rename both a Git local and remote branch name?
body: <p>I have four branches like master -> origin/regacy, FeatureA -> origin/FeatureA. As you can see, I typed the wrong name.</p>
  
  <p>So I want to rename a remote branch name (origin/regacy → origin/legacy or origin/master)</p>
  
  <p>I try the command below:</p>
  
  <pre><code>git remote rename regacy legacy
  </code></pre>
  
  <p>But Git console returned an error message to me.</p>
  
  <pre><code> error : Could not rename config section 'remote.regacy' to 'remote.legacy'
  </code></pre>
  
  <p>How can I solve this problem?</p>