How to check compare changes on a topic branch to master

Posted . Visible to the public.

If I want to compare changes on a topic branch to master, I find it easiest and safest to do the following:

git checkout master
git checkout -b trial_merge
git merge topic_branch

After completing the merge, it is easy to see the consolidated change from master

git diff master

When done, simply delete the trial_merge branch

git checkout master
git branch -D trial_merge

This way, the master branch never changes.

In TortoiseGit

  1. Switch/Checkout master
  2. Create Branch... based on master, name it trialmerge
  3. Switch/Checkout trialmerge
  4. Git Merge... topicbranch
  5. Diff with previos version
  6. check the diff
  7. Switch/Checkout master
  8. delete trialmerge
kiatng
Last edit
kiatng
Posted by kiatng to Git (2015-02-26 05:15)