Feature branch workflow in sourcetree
Asked by James Ward:

Trying to follow the Feature branch workflow as described by Atlassian at <https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow> from within Sourcetree. I'm fine up until it comes time to pull the feature branch from origin into master. If I do this in Sourcetree I get the warning: Are you sure you want to pull from a non-tracked branch? If I just do the git pull from the command line everything proceeds without any issues. Is Sourcetree being more strict than my command line git or is it actually doing something different? Here are some screenshots. My feature branch is called second-test.

Screen Shot 2015-06-04 at 10.53.47 PM.png

Screen Shot 2015-06-04 at 10.54.56 PM.png  
[](https://community.atlassian.com/t5/Sourcetree-questions/Feature-branch-workflow-in-sourcetree/qaq-p/212024?attachment-id=11197){#link_116a3e01602c2e}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/6243/1/Screen%20Shot%202015-06-04%20at%2010.53.47%20PM.png){#display_116a3e01602c2e_0}  
[](https://community.atlassian.com/t5/Sourcetree-questions/Feature-branch-workflow-in-sourcetree/qaq-p/212024?attachment-id=11198){#link_116a3e01602c2e_0}  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/6243/2/Screen%20Shot%202015-06-04%20at%2010.54.56%20PM.png){#display_116a3e01602c2e_2}


Answers:
author: Seth
body: Additionally, what the warning is trying to tell you is that you are pulling a branch directly from remote, rather than one of your local branches. If the branch is one that you don't have checked-out (tracked) locally, then it's more difficult to review the contents of the branch to be sure you want it merged in.

The tutorial says to use "pull" from remote instead of "merge" (potentially with the local branch) because it "makes sure you're always pulling the most up-to-date version of the feature branch". If you are merging in a feature branch that you are working on alone, there is no risk of being out-of-date, so you can avoid the warning by merging the local feature branch instead of pulling the remote feature branch.

comments: author: James Ward
body: As you can see I using pull both in Sourcetree and from the command line as the tutorial recommends. The tutorial specifically says to pull in the feature branch from origin which is what I do here. This portion of the tutorial is under "Mary publishes her feature" and the commands described are:git checkout mastergit pullgit pull origin marys-featuregit pushWith the exception of the name of my feature branch I believe I am doing the exact same thing in Sourcetree and it certainly works as expected from the command line. I guess my bottom line is I find it odd that Atlassian wrote a tutorial that their software says is not recommended behaviour.


author: James Ward
body: Well I'm still surprised that Sourcetree software advises against behaviour that they seem to advocate for, yours is certainly the correct answer.


author: sreekumar_menon
body: Since your current branch is master , when you do a git pull from command line, you are getting the latest from origin/master -\> master

But in sourcetree ,assuming that master is still your current branch, you are trying to pull from origin/second-test -\>master (as per your screenshot) ,which is why sourcetree gives you that warning.

comments: author: James Ward
body: You can see the in my first screenshot the command-line pull I ran is:git pull origin second-testMaking it identical to what I did in Sourcetree.


author: Bal?zs Szakm?ry
body: SourceTree is doing the same thing (you can check the cmd output once you actually run this), but it warns you that you are potentially doing something else than what you wanted. If this is something you repeatedly do, check the "Don't ask me again" checkbox.

comments: author: James Ward
body: I think it is odd that Atlassian wrote a tutorial including behaviour that their software warns against. I'm aware I can make the warnings go away but I want to understand why a workflow they recommend on their website throws warnings in their software. I assumed I missed a trick in Sourcetree early in the workflow but it now seems that is not the case.