Reviewing and Commiting Feature Branches Merges in Git

When you want someone to review your branch, it is best to have a single diff they can look at instead of browsing the history of your branch.

Assume we are in branch feature_branch and branched from develop.

Show the commits in branch feature_branch (which we are in) since branching from develop. Verify that it looks ok.

[feature_branch *] $ git log develop..

To get the diff of what will be merged, do

[feature_branch *] $ git diff develop..feature_branch

or

[develop] git diff ...feature_branch

After someone reviews your commit, you can merge it in.

[feature_branch *] $ git checkout develop
[develop *] $ git merge feature_branch

References


Git