Search code examples
gitsourcetree

Git merge master into remote tracked feature branch


My team recently converted from Using Perforce to Git for source control. One question I cannot find a good answer on is how to properly integrate changes changes from origin:master into my feature branch that is origin tracked (two developers are making commits into the branch).

I tried to perform a Merge from master, but then I see a merge commit that shows all of the files I have modified in the current branch. Is this expected?

Note that my team is using SourceTree instead of command line.


Solution

  • If the feature branch is used by multiple members of your team merge is the best option, in other cases I prefer use rebase.

    Merge are fast-forward (--ff) by default and whenever it is possible, in case of not (conflits, etc) they will be not fast forwarded (--no-ff).

    When are not fast-forwarded they produce an additional merge-commit (like in your case) with a message informing us about the merged branch (and parents commits refs).

    Some people (and tools like GitHub) prefer force --no-ff merges for readability and clarity of git logs.