문제

I am using Atlassian SourceTree and I have git set on BitBucket. My scenario is the following:

  • I created a local branch (enhancement let's say it) of another branch, develop in my case.
  • I made some changes and committed them to enhancement.
  • Finally, I Merged enhancement to develop having SourceTree's "create a new commit even if fast-forward is possible" option set, hoping that this will effectively set --no-ff flag on.

I push to BitBucket and then I see this:

enter image description here

What I was expecting to see was commit ccaad53 right after 281f45e, without the intermediate 5 commits. Instead the history is retained. Is this supposed to be working that way, or am I doing something wrong?

EDIT: changed title to something more specific.

도움이 되었습니까?

해결책

If you have 5 commit in local branch after the 281f45e and later you merged this branch with develop with --no-ff flag, the result it's as your image. Therefore, the response it's "yes", the graph result it's right.

Moreover if you was expecting only one commit after 281f45e with you changes, you need execute before: git rebase -i HEAD~5 to convert last 5 commit into one commit and then apply merge strategy.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top