Using SVN, the workflow I followed in order to ensure that I didn't break the build was:
- Do work
svn update
to get latest commits from others into my wc- Recompile, run tests, fix any issues (e.g., reliance on API that I am changing)
svn commit
When I try to replicate this workflow in Git, I get the dreaded "Your local changes to the following files would be overwritten by merge" error.
What are the steps to merge origin changes into my local copy so I can validate before committing? Is there a way to specify to merge each file and edit conflicts like in SVN?
One difference between Git and SVN is that Git splits the "record my changes to the code" step into two steps: a commit, and a push, whereas SVN just has a commit. In Git, the resolution of conflicts happens after the commit, but before the push. This means that the process seems almost "opposite" to SVN, where you update, then resolve conflicts, then commit. In Git, you want to instead commit, then pull (at which point you may resolve conflicts), then push.