Hi!
I'm new to git and SourceTree. We plan to use git in our new project with git flow. I tested features of SourceTree and have one question.
When I start a new feature, make one commit and finish the feature - history looks linear - as if I simply committed to the develop branch. But when I start a feature, make two or more commits and finish it - then the history shows branches from develop.
Is it behavior correct or did I miss something? I tried the same thing with another git tool and got expected results. I prefer SourceTree however and want to solve this issue.
# merge into BASE git_do checkout "$DEVELOP_BRANCH" if [ "$(git rev-list -n2 "$DEVELOP_BRANCH..$BRANCH" | wc -l)" -eq 1 ]; then git_do merge --ff "$BRANCH" else if noflag squash; then git_do merge --no-ff "$BRANCH" else git_do merge --squash "$BRANCH" git_do commit git_do merge "$BRANCH" fi fi
But I have no idea why there is this "if" with fast-forward and without fast-forward.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There's an open issue regarding this - https://github.com/nvie/gitflow/issues/292. Seems that it was author's decision, with no explanation given.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sergey,
This sounds like a simple case of a fast forward commit which means your commit is directly upstream of the branch. The git-scm docs explain it well:
You’ll notice the phrase "Fast forward" in that merge. Because the commit pointed to by the branch you merged in was directly upstream of the commit you’re on, Git moves the pointer forward. To phrase that another way, when you try to merge one commit with a commit that can be reached by following the first commit’s history, Git simplifies things by moving the pointer forward because there is no divergent work to merge together — this is called a "fast forward".
A fast forward commit is the default in SourceTree because in those cases there's usually no need to have a branch history like that, it may as well be linear. You can turn this off though from within SourceTree by turning the checkbox "Create a commit even if merge resolved via fast-forward" from the merge sheet.
Hope that helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I can do it with plain merge (button Merge on toolbar), thank for your advice, and I already try it. It works. But can I reach this goal by git flow feature (button Git Flow on toolbar)? Or when SourceTree finish gitflow branch it always do fast-forward in merge?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for help, I post my own answer to my question. Can you provide may be any comments to this answer?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.