<img width="720" alt="screen shot 2017-10-16 at 12 02 58 am" src="https://user-images.githubusercontent.com/16771854/31599004-66c96c2c-b205-11e7-8fd5-5994f8460810.png">
<img width="764" alt="screen shot 2017-10-16 at 12 02 30 am" src="https://user-images.githubusercontent.com/16771854/31598980-5358219c-b205-11e7-9e60-c12756972e5c.png">
Now, preparation work is done, and the project log becomes:
<img width="1000" alt="screen shot 2017-10-16 at 12 03 24 am" src="https://user-images.githubusercontent.com/16771854/31599022-76413720-b205-11e7-9812-06ca98b02520.png">
### Step1: Rebase `Feature3` branch
git checkout Feature3
git rebase Feature2
<img width="583" alt="screen shot 2017-10-16 at 12 04 57 am" src="https://user-images.githubusercontent.com/16771854/31599076-ac7015be-b205-11e7-9e34-b5ea745d4c81.png">
As there is no new commit on `Feature2`, no rebasing happens.
### Step2: Merge `Feature3` back to `Feature2`
git checkout Feature2
git merge Feature3
<img width="588" alt="screen shot 2017-10-16 at 12 06 39 am" src="https://user-images.githubusercontent.com/16771854/31599138-e9131200-b205-11e7-8a36-6f76c9346500.png">
A fast-forward merge is done. And the project history becomes (no extra commit):
<img width="1006" alt="screen shot 2017-10-16 at 12 07 24 am" src="https://user-images.githubusercontent.com/16771854/31599170-02e59f36-b206-11e7-89b0-0d0addeb80c6.png">
### Step3: check `git log` and `git reflog`
git branch
git log
git reflog
<img width="552" alt="screen shot 2017-10-16 at 12 09 01 am" src="https://user-images.githubusercontent.com/16771854/31599221-4c3290b8-b206-11e7-86d7-bf122067b578.png">
<img width="514" alt="screen shot 2017-10-16 at 12 09 23 am" src="https://user-images.githubusercontent.com/16771854/31599222-4c57de72-b206-11e7-80d2-18e2c9ce570d.png">
As we can see,
* the `fast-forward` commit record is not seen from `git log`, however, it is noted in `git reflog`
* as no rebasing is done, no record about `rebase` is found.
Feature3 branch derived from Feature2, rebase Feature3 before merging
Scenario abstract
Feature2
andFeature3
),Feature3
was derived fromFeature2
;Feature3
branch was created, there was only commits onFeature3
branchFeature3
back toFeature2
Feature3
branch --git rebase Feature2
Results:
Data could be explored:
fast-forward merge
record can be found fromgit reflog
Detailed steps:
Step0: prep
test13
onFeature2
branchsync
Feature2
andFeature3
create a new commit on
Feature3
branch only For example, re-edit test filetest13
edit test13
git add test13 git commit -m "Feature3: edit the file test13"
git checkout Feature3 git rebase Feature2
git checkout Feature2 git merge Feature3
git branch git log git reflog