Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Feature branch workflow in sourcetree

James Ward June 4, 2015

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

3 answers

1 accepted

0 votes
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2015

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.

James Ward June 5, 2015

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 master git pull git pull origin marys-feature git push With 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.

James Ward June 5, 2015

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

0 votes
sreekumar_menon
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 5, 2015

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.

James Ward June 5, 2015

You can see the in my first screenshot the command-line pull I ran is: git pull origin second-test Making it identical to what I did in Sourcetree.

0 votes
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 4, 2015

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.

James Ward June 5, 2015

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events