[testcase notes] #14: rebase branch Feature2 on Feature3 (only commit on Feature2, base branch)
Opened this issue · 0 comments
dorawyy commented
Feature3 branch derived from Feature2, rebase Feature3 before merging
Scenario abstract
- developer1 worked on two branches (
Feature2
andFeature3
),Feature3
was derived fromFeature2
; - after
Feature3
branch was created, there was only commits onFeature2
branch - now developer1 would like to merge
Feature3
back toFeature2
- however the developer would like to rebase
Feature3
branch --git rebase Feature2
- What would happen?
Results:
- no conflict, fast-forward
rebase
, no merge happened (as already up-to-date)
Data could be explored:
- record of
rebase
ingit reflog
only. ( no record ingit log
, no visible commit)
Detailed steps:
Step0: prep
- create and edit test file
test14
onFeature2
branch
git checkout Feature2
touch test14
# edit test14
git add test14
git commit -m "testcase14: startpoint (create file test14)"
- sync
Feature2
andFeature3
git checkout Feature3
git merge Feature2
- create a new commit on
Feature2
branch only
For example, re-edit test filetest14
git checkout Feature2
# edit test14
git add test14
git commit -m "Feature2: edit the file test14"
Now, preparation work is done, and the project log becomes:
Step1: Rebase Feature3
branch
git checkout Feature3
git rebase Feature2
Feature3
branch moves 1 commit forward to be sync with Feature2
branch. The rebase went smooth, no conflict. Also, as Feature3
has no commit, the head
of Feature3
and Feature2
point to the same commit already.
Step2: Merge Feature3
back to Feature2
git checkout Feature2
git merge Feature3
no commit to merge, no change.
Step3: check git log
and git reflog
Feature2
branch:
git checkout Feature2
git branch
git log
git reflog
Feature3
branch:
git checkout Feature3
git branch
git log
git reflog
As we can see,
- the
rebase
process is done with no extra commit- no record in
git log
- only visible in
git reflog
- no record in
- as no extra commit on
Feature3
, no merge is done