RubyMine 2017.1 Help

Merging, Deleting, and Comparing Branches

On this page:

To merge a branch

  1. Invoke the Branches menu as described in Accessing Git Branches Popup Menu.
  2. Select a branch in the pop-up list that shows all available local and remote branches, and choose Merge from the submenu. The selected branch will be merged into the branch that is currently checked out.

    If there are merge conflicts, you will be prompted to resolve them.

    If your local changes are going to be overwritten by merge, RubyMine suggests to perform smart merge (similar to smart checkout.

To delete a branch

  1. Invoke the Branches menu as described in Accessing Git Branches Popup Menu.
  2. Select a branch in the pop-up list that shows all available local and remote branches, and choose Delete from the submenu.

    After you have deleted a branch, a notification will be displayed in the bottom right corner from which you can restore the deleted branch:

    /help/img/idea/2017.1/deleted_branch_notification.png

    If the deleted branch contained commits that have not yet been merged to its upstream branch or to the current branch, it will still be deleted immediately (equivalent to the git branch --D or git branch --delete --force command), but the notification will also contain a link allowing you to view the unmerged commits.

    If the deleted branch was tracking a remote branch, you will also be able to remove the remote branch from this notification.

To compare branches

  1. Invoke the Branches menu as described in Accessing Git Branches Popup Menu.
  2. Select a branch in the pop-up list that shows all available local and remote branches, and choose Compare from the submenu.

    RubyMine compares the branch that is currently checked out with the selected branch.

  3. In the dialog that opens, compare the differences in the following two tabs:
    • Log: this tab lists the commits that exist in the current branch, and are missing in the selected branch, and vice versa.
    • Diff: this tab shows the differences between files existing in both branches. Use the Show Diff command on the context menu of a file to explore the differences between branches.

See Also

Last modified: 23 March 2017