What's the difference between "rebase onto" and "pull using Rebase" ?
Answered
This is so confusing to have two commands, that seems to be doing exactly the same …
Please sign in to leave a comment.
Is this AI generated answer?
In IDEA these commands do exactly same. Rebase onto could have been different if it was asking “which particular commits to rebase”, but it rebases everything, which is exactly what “pull rebase” does.
Are you referring to the following two options?
* main menu > Git > Pull.. > modify options > --rebase > select remote branch
* VCS widget > select branch > Rebase ‘branch1’ onto ‘branch2’
Both options that I ask about are on your second screenshot. First one you clicked, and second one just 2 lines down.
Thank you for the information.
The pull into current using rebase action downloads the new changes from the remote repository and then does a rebase of the currently checked-out branch on top of these changes. It runs the following git commands in sequence:
git fetch origingit rebase origin/<branch>This action is available only for remote branches.
The rebase current onto selected action rebases the currently checked-out branch on top of the selected branch. It runs the following git command:
git rebase refs/remotes/origin/<branch>This action is available for both local and remote branches.
So they are exactly the same? except for “fetch” part.
How about either removing second one, or renaming them to:
Thanks for the update.
Actually, git pull represents two commands in sequence: git fetch & git merge or git rebase.
So the naming: pull using rebase is pretty accurate and self-explanatory when it comes to git commands naming.
Rebase is a separate git command which doesn't really depend on, or is related to fetch. So it should not be required to explain that the action does a rebase without a fetch - this should be expected and intuitive from the original name: rebase current onto selected - since it doesn't mention pull or fetch.
If IDEA is a thin client to git, then what you say would make sense.
However, IDEA is a powerful product, and that's why we love it.
Many of VCS operations in IDEA are not a single git command. Even pull in IDEA is a complex workflow: it stashes, applies merges, then unstashes changes. And if you look at console log it does even more, lots of git commands and parameters which I have no knowledge what they mean. And this all is hidden from user. And let me repeat, this is why we love it.
So for me it sounds obvious that IDEA should show a single option in that menu. And name should be extremely clear, e.g. “fetch & rebase onto” would be extremely clear name.
If rebase without fetch is needed for somebody, then it should be moved to top level menu, where more advanced commands are present.
P.S. this whole topic started because we have interns at our company, and they are asking me what these buttons do. And replying to them the truth that “I, senior developer and power user of Jetbrains products since 2004, think it is just an IDEA bug, and that I usually choose randomly which one to click, because they do exactly same”.
Thank you for the update.
I created a new report for it on our issue tracker: https://youtrack.jetbrains.com/issue/IJPL-197636.
Please vote for it and follow to see any comments from developers.