Assumption
- Sample branches' status
/--- commit1--- commit2 `feature-1`
/
*----*----* `develop`
\
\--- commitA --- commitB `feature-A`
- Changes in branch
feature-1
andfeature-A
have no conflicts
Do a rebase
Case 1: On branch feature-A
, rebase branch feature-1
$ git checkout feature-A
$ git rebase feature-1
First, rewinding head to replay your work on top of it...
Applying: commitA
Applying: commitB
- Then the commit history will look like this:
/--- commitA --- commitB `feature-A `
/
/--- commit1--- commit2 `feature-1`
/
*----*----* `develop`
Case 2: On branch feature-1
, rebase branch feature-A
$ git checkout feature-1
$ git rebase feature-A
First, rewinding head to replay your work on top of it...
Applying: commit1
Applying: commit2
- Then the commit history will look like this:
/--- commit1 --- commit2 `feature-1 `
/
/--- commitA--- commitB `feature-A`
/
*----*----* `develop`