Toshi
Toshi

Reputation: 6360

git rebase; how to fast-forward

I'm confused about this situation.

I basically develop alone, but sometime my teammate add some feature. So I made a develop branch.(It's still beta phase, so I don't want to merge add-subscripiton branch to develop.)

I'd love to make 'develop' branch catch up withadd-subscription branch.

I could do something like

git checkout develop
git rebase add-subscription

However this messes the history up. How can I work around?

enter image description here

Upvotes: 1

Views: 1210

Answers (1)

Simon Fromme
Simon Fromme

Reputation: 3174

If you want all commits of add-subscription in develop you can do

git checkout develop
git merge add-subscription

which keeps develop up-to-date with add-subscription but leaves add-subscription untouched.

If you only want certain (but not all) commits from add-subscription in develop you can use

git checkout develop
git cherry-pick <commit>...

Both methods (in contrast to rebase) do not change history.

Upvotes: 1

Related Questions