Pergunta

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.

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top