title: What happens when Git pull or push to different branch being in some other branch
body: <p>I am familiar with GIT and using the same for versioning of my project.</p>
  
  <p>I am having few queries which I would like to know. I googled but couldn't get the good answer.</p>
  
  <p>So the thing is I am having <strong>master, module1, feature1</strong> branches.</p>
  
  <pre><code>master
   ---------- 
           | module1
           ----------
                    | feature1
                    ------------
  </code></pre>
  
  <p>module1 is branched from master and feature1 is branched from module1.</p>
  
  <p><strong>Query 1</strong> : Being in feature1 branch what if I work on few changes and commit and push the same to module1.</p>
  
  <pre><code>git add .
  git commit -m "Changes of feature1"
  git push origin module1 //Being in feature1 branch
  </code></pre>
  
  <p>What happens here to the code of feature1 to module1 branch and how module1 branch takes it.</p>
  
  <p><strong>My Understaing</strong> : As per my understanding the feature1 changes will be pushed to module1 branch. And later I realised that I should have pushed to feature1 branch then I will push the same to feature1 branch and will checkout to module1 branch and revert the code which I had pushed recently.</p>
  
  <p><strong>Query 2</strong> : What if being in the feature1 branch and I pull the code of module1 in this branch by the following</p>
  
  <pre><code>git pull origin module1 //Being in feature1 branch
  </code></pre>
  
  <p><strong>My Understanding</strong> : The changes of the module1 code will get merged to my feature1 branch and is same as the following in commands</p>
  
  <pre><code>git checkout moduel1
  git pull origin module1
  git checkout feature1
  git merge module1
  </code></pre>
  
  <p>If there are any conflicts will be shown. Which I need to resolve.</p>
  
  <p>Can anyone help me whether my understanding is correct or not. If not please help me to understand this concept properly. Thanks in advance.</p>