Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the advantage of the rebase command in Mercurial?

Tags:

mercurial

Compare to standard push/pull, what is the advantages of using the rebase command in Mercurial?

like image 999
Vincent Avatar asked Mar 25 '10 14:03

Vincent


People also ask

What is rebase in mercurial?

Rebase allows moving commits around in Mercurial's history (using a series of internal merges). This has many uses: moving changesets between branches. "linearizing" history. reordering changesets.

What is the use of rebase command?

Rebase is one of two Git utilities that specializes in integrating changes from one branch onto another. The other change integration utility is git merge . Merge is always a forward moving change record. Alternatively, rebase has powerful history rewriting features.

What is rebase in git with example?

Rebasing is a process to reapply commits on top of another base trip. It is used to apply a sequence of commits from distinct branches into a final commit. It is an alternative of git merge command. It is a linear process of merging.

How do I rebase a git command?

Another option is to bypass the commit that caused the merge failure with git rebase --skip . To check out the original <branch> and remove the . git/rebase-apply working files, use the command git rebase --abort instead. NOTE: The latter form is just a short-hand of git checkout topic followed by git rebase master .


1 Answers

This post has a nice explanation:

The answer lies in rebasing. Rebasing is a technique made popular by git where you rewrite your not-yet-pushed patches so that they apply against the current remote tip, rather than against the tip of the repository you happened to last pull. The benefit is that your merge history shows useful merges—merges between major branches—rather than simply every single merge you did with the upstream repository.

Normal pull, merge, push sequence will create a number of commits that are not very useful in terms of the history of your repository. Rebasing helps to eliminate these.

like image 123
Vincent Ramdhanie Avatar answered Sep 21 '22 19:09

Vincent Ramdhanie