Go - rebase

rebase scenarios

Suppose we now have the hands of a demand, it takes five days to complete the development. But after a one-time submission can not wait five days to submit a one-time if, in the middle may have to revert to a version, there is no way, so once a day we commit, the fifth day of the following when using git log View

Can we submit that the combined record about it, of course you can, git git rebase provides us with a method

rebase in two ways

The first version number
# git rebase -i 810657ae78dafe248cd629df07bd2a6e9684781a

We use the above version of v2, v2 and said it would above it merged version (v2, v3, v4)

The second use HEAD
# git rebase -i HEAD~3

This same as the first, said it would merge the latest three

After enter into the following pages

We will pick v3 and v4 instead of s, it said it would be a merged version v4 and it's on, that is, v3 and v4 merger, because v3 is s, so the v3 and it's on a (v2) merger

Save and exit will enter the following page

This page is Let's add something similar to a merger explanation like after the merger. Because v2, v3, v4 are submitted to our records, git show gave us in this, we can delete your writing

Save and exit using git log look

This will be our version submitted for a merger

Note: We assume that the v2 version has been submitted to the github, the merger is best not to merge v2, v3 and v4 merger only on it, if v2 also merge, it is inconsistent on local and github, it will produce some unnecessary trouble.

Guess you like

Origin www.cnblogs.com/zouzou-busy/p/11694036.html