The diff view allows to show the difference between branches in a single file tree. You’ll get a dialog, where there are commits existing in current branch and absent in selected branch, and vice versa. Select a branch from the popup and choose Compare. There are two modes of branches comparison: git log and git diff. If you have local branches tracking the remote branch, you may delete them as well. Remote branch is deleted, as usual via git push :, but since it is a potentially dangerous operation, it is made with confirmation. Based on this information you may make a decision to delete the branch right away. However if a branch is not fully merged, you’ll get a helpful dialog which shows the warning together with the list of unmerged commits and the list of branches selected branch is merged to (if there are such branches). Just select it in the list, select Delete, and that’s all. Deleteĭeleting a local branch fully merged to the current branch is very simple. When a local branch is merged, you can delete it right away. We have plans to add rebase action here as well, but rebase operation is much more complex than merge, so it will take time. Merge also captures the error we talked above and proposes Smart merge procedure. Common workflow is create a feature branch, make changes there, checkout master and merge feature to master. The merge action merges selected branch into the current branch, simply like git merge. It can be useful if you work on a feature branch and want to start another feature from master.Ĭheckout remote branch as new local branch serves the same purpose, but in addition to that it sets ups tracking. If a conflict happens during unstash, merge dialog is shown.Ĭheckout as new local branch is just a shorthand for Checkout + New branch. IntelliJ IDEA handles this situation and offers Smart checkout, which shows the files preventing checkout and offers to stash local changes, checkout the branch, and then unstash changes back. But sometimes you may want to checkout with dirty working tree, and if the local changes would be overwritten by checkout, Git fails with an error. Usually when you checkout a branch, you have clean working tree, and everything just works. Have a look at each of these features, since there are some niceties which IntelliJ IDEA offers to user. You may also create and checkout a new branch (like git checkout -b ) and checkout a specific revision or tag. Each branch can be checked out, compared or merged with current branch or deleted. The popup shows the list of all local and remote branches available. Personally, I prefer using keyboard, and I’ve assigned a shortcut ( Settings | Keymap) to the action. The Git branch popup menu is available from Main Menu | VCS | Git | Branches, from Context Menu | Git | Branches, from the VCS Operations Popup, and also when you click the widget in the status bar, which shows the current Git branch. Let’s take a look at the features which the IDE offers to manage Git branches. The main goal of new interface is to concentrate on the most common use cases. In IntelliJ IDEA 11.1 we have polished the look and feel, and made it more functional. You might have noticed that in IntelliJ IDEA 11.0 we’ve added new interface to checkout branches from Git. We in Jetbrains want to make workflow with branches even more convenient and simple than it is in command line. Lightweight and fast branches are one of the major features and advantages of Git.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |