title: How to properly sync main git branch, remote branch and local branch?
body: <p>We use github for tracking our code. Each developer creates a remote branch from the main branch and a local branch from the remote branch.</p>
  <p>Let's say the main branch is A, the remote branch is B, and the local branch is C.</p>
  <p>Let's say a file README has just one line in it:</p>
  <pre><code>LineX
  </code></pre>
  <p>At the beginning, this file has the same contents on all three branches.</p>
  <p>Let's say I add one line into this file in my local branch.</p>
  <pre><code>LineX
  LineY
  </code></pre>
  <p>Meanwhile, someone added another line on branch A and committed it.</p>
  <pre><code>LineX
  LineZ
  </code></pre>
  <p>Here is how the contents would look at that point:</p>
  <pre><code>Branch A:
     LineX
     LineZ
  
  Branch B:
     LineX
  
  Branch C:
     LineX
     LineY
  </code></pre>
  <p>I need to pull the changes from Branch A into C so that my local content would become:</p>
  <pre><code>LineX
  LineY
  LineZ
  </code></pre>
  <p>Also, I feel Branch B must be synced with A. Otherwise, my code review will show two lines of changes instead of one line.</p>
  <p>I am wondering what is the proper way to do this. Thanks.</p>