achalk
achalk

Reputation: 3449

What exactly does `git rebase --skip` skip during a rebase?

When you perform a rebase, git asks for manual intervention if it can't resolve differences between your current branch and the new base branch.

If you resolve conflicts and type git rebase --continue, git treats the resolved code as the 'new code' for that commit.

But what happens when you hit git rebase --skip? It can't leave the code as it is—there are conflicts—so it must be doing something more than just 'skipping'.

Upvotes: 16

Views: 11131

Answers (1)

Code-Apprentice
Code-Apprentice

Reputation: 83537

If there is a conflict, git rebase --skip simply skips the entire commit. The changes from that commit will not be in the history after the rebase finishes successfully. Let's look at an example

A-B-C <- master
 \
  D-E <- foo

Now say D causes a conflict after

git checkout foo
git rebase master

Then git rebase --skip results in

A-B-C <- master
     \
      E' <- foo

where E' contains the same textual changes as E.

Upvotes: 24

Related Questions