I think local branch can be used in your scenario, which is also a significant advantage of git.
Saying you are working on master
branch, just create a new branch called dev
, do your work and commit as you wish on dev
branch. If you want to send your local changes to others, just git diff
the two branches and send out the results. Or you can even let others to pull your dev
to have a review.
git diff master dev > myfile.diff
And if you want to push your changes to a remote central repository, just merge dev
back to master
and push. Git will help you do most of the work in the process.
PS. you guys may try some code review system integrated with git well such as Phabricator which is really fantastic and convenient.