title: git commit best practices
body: <p>I am using git to manage a C++ project. When I am working on the projects, I find it hard to organize the changes into commits when changing things that are related to many places. </p>
  
  <p>For example, I may change a class interface in a <code>.h</code> file, which will affect the corresponding <code>.cpp</code> file, and also other files using it. I am not sure whether it is reasonable to put all the stuff into one big commit.</p>
  
  <p>Intuitively, I think the commits should be modular, each one of them corresponds to a functional update/change, so that the collaborators could pick things accordingly. But seems that sometimes it is inevitable to include lots of files and changes to make a functional change actually work.</p>
  
  <p>Searching did not yield me any good suggestion or tips. Hence I wonder if anyone could give me some best practices when doing commits.</p>
  
  <p>PS. I've been using git for a while and I know how to interactively add/rebase/split/amend/... What I am asking is the PHILOSOPHY part.</p>
  
  <p>Update: Thanks for all the advices. Maybe this should be learned from practicing. I will keep the problem open for some time to see if there is more suggestions.</p>