I have already read a lot but merge and rebase still confuse me.
I have 2 branch -- Develop and Feature, the Feature branch is branched from one of Develop commits. I use Dx to represent the commit of Develop, and Fx to represent the commit of Feature, where x denotes the number.
In the beginning, I want to add a new feature so I branch a Feature from Develop
Develop D1----D2
\
Feature F1
after some days, I pushed some commits in Feature, and so does Develop.
Develop D1----D2----D3----D4
\
Feature F1----F2----F3
I found that the Feature need the updates of Develop, so I decided to apply the D3 and D4 into my Feature
In my thought, rebase is a better choice here, and my log would be like
Develop D1----D2----D3----D4
\
Feature F1----F2----F3
But in fact, the log become
Develop D1----D2----D3----D4
\
Feature F1----F2----F3----D3----D4
and now is my problem... Should I use merge or rebase in this situation?
I think rebase is better here, but I have found a golden rule in some websites, such as git-scm.com told that Do not rebase commits that exist outside your repository.
In my situation, the D3 and D4 are the commits that exist outside my repository?