title: git submodule commit/push/pull
body: <p>I'd like to use git submodule.  </p>
  
  <p>The steps I need to take to push my changes to my project are</p>
  
  <blockquote>
    <ol>
    <li>add/commit/push from submodule directory</li>
    <li>add/commit/push from parent directory</li>
    </ol>
  </blockquote>
  
  <p>Steps I need to take to pull changes of my project.</p>
  
  <blockquote>
    <ol>
    <li>git pull from parent directory</li>
    <li>git submodule update from parent directory</li>
    </ol>
  </blockquote>
  
  <p>Steps for updating the submodule from its original repo</p>
  
  <blockquote>
    <ol>
    <li>git pull from submodule directory</li>
    </ol>
  </blockquote>
  
  <p>What worries me is the following exerpt from <a href="http://git-scm.com/book/en/Git-Tools-Submodules" rel="noreferrer">http://git-scm.com/book/en/Git-Tools-Submodules</a></p>
  
  <blockquote>
    <p>The issue is that you generally don’t want to work in a detached HEAD
    environment, because it’s easy to lose changes. If you do an initial
    submodule update, commit in that submodule directory without creating
    a branch to work in, and then run git submodule update again from the
    superproject without committing in the meantime,(<strong>?? update/commit/update will lose change?</strong>) Git will overwrite
    your changes without telling you. Technically you won’t lose the work,
    but you won’t have a branch pointing to it, so it will be somewhat
    difficult to retrieve.</p>
    
    <p>To avoid this issue, create a branch when you work in a submodule
    directory with git checkout -b work or something equivalent. When you
    do the submodule update a second time, it will still revert your work,
    but at least you have a pointer to get back to.</p>
  </blockquote>
  
  <p>I'm going to modify submodules and don't wanna mess up, the doc above briefly mentions the possibility of losing change, and I don't understand what might cause the loss.   </p>
  
  <blockquote>
    <p>I wonder what additional steps more than I listed above I need to take to prevent the
    loss.
    Especially several team members modify submodules, what do they need to do not to mess up?</p>
  </blockquote>