I know how to rebase onto a specific branch or tag using eGit in Eclipse, but I haven't found a way to rebase onto a specific sha1 using eGit. I'd like to do this in order to squash commits before pushing to upstream (ie, doing git rebase -i HEAD~n
where n is some number of commits ago where I want to rebase). Is this possible with eGit? If not, is there another Eclipse plugin I should be using that would provide this functionality?
I've been successful squashing commits using steps from this post (cut and pasted here):
If I want to squash the last m commits on the current branch then I
EGit有rebase,但它还没有你要求的交互式rebase。
It is currently available in Eclipse Oxygen
, it has it's own wizard for it.
History
view Rebase interactive
and click it It works just like the console version, but on a GUI. Even if conflicts arise, it will help you through.
From the history view select the commit you want to rebase to, and create a branch called rebase-point
or whatever. Voila, you can now rebase to that branch, and delete it later if you want. I generally prefer using a named branch for things like this anyway, because it minimizes the chance for mistakes on my part. Alternately, consider that origin/master
is often the right rebase point if you're squashing commits for a push.
You can also rebase from the Eclipse History view.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.