Why does `git rebase` apply all commits and not just apply the latter?

I know how it works git rebase, and I use it in production for a while. It repeats all the commit commit to another branch. It overwrites the history of your current branch.

I recently started playing with git rebase --skip, although initially I was terrified of this. I understand that he just skips it as if it never happened.

It seems to me that the resulting working directory in these two cases will be the same:

1) all commits are skipped, except for the last

2) all commits are replayed, so commits are resolved in favor of branching their.

Reminder : their- This is the branch that you are currently in when you rebuild.
Another reminder . I am particularly interested in the working directory. This is the same?

Is it true that the working directory is the same result?

+4
source share
1 answer

In general, no. Repeating a fix is ​​very similar to an operation cherry-pick. The repository state does not apply, only the patch (= diff, changeset, ...) corresponding to this commit. If you skip commits, you omit a set of changes that may or may not lead to conflicts. In any case, only missed empty commits give the same results overall.

, , , . git rebase, . (, , , "" . , , "", "" , .)

+6

Source: https://habr.com/ru/post/1606644/


All Articles