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

Sourcetree cannot find git-flow (OSX Mountain Lion)

Ken Ficara September 3, 2012

I used the "Git Flow" button in Sourcetree to initialize my repository and successfully started a feature. But when I click Git Flow / Finish Current, choosing "rebase on development" and "delete branch," I get the error, "git: 'flow' is not a git command. See 'git --help'."

This does not happen if I don't choose "rebase." Then it properly finishes the feature and merges it into my develop branch.

This does happen whether I use the embedded git or the system git. git-flow is installed on my command line and in my path:

$ which git-flow
/usr/local/bin/git-flow

What is wrong here?

5 answers

1 accepted

0 votes
Answer accepted
stevestreeting
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.
September 4, 2012

Hmm, you actually don't need to have git-flow installed locally, it's included in the SourceTree package and the same version used regardless of whether you use the system git or embedded git (this is because git-flow in SourceTree includes a few fixes, which have been accepted upstream but aren't in the official release yet).

However, I can reproduce this here too with a test project.

Logged as a bug here: https://jira.atlassian.com/browse/SRCTREE-1183

Ken Ficara September 4, 2012

Thank you -- I didn't think I would have to install it locally, but I thought it would have helped when I switched it to using the system git. In any case, appreciate the quick response.

0 votes
Jan Mueller October 22, 2012

Hi,

thank you for the support. I redid everything and I think I know what was missing at the beginning: I had to click the gitflow icon once and then initalize. I probably skipped the dialogue with [esc] in the first place because everything looked OK and I did not change anything. I understand it now - thanks again.

The linked article is also very helpful.

have a great day!

0 votes
Jan Mueller October 21, 2012

that's weird. I ran into the same issue (can't select any features even though the features exist).

I even installed git-flow globally (using the sh provided in this tutorial: http://yakiloo.com/getting-started-git-flow/) and which git-flow gives me

which git-flow
/usr/local/bin/git-flow

though if I read correctly it is not necessary.

Wonder what else I am doing wrong. Any idea?

<body></body>
stevestreeting
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.
October 21, 2012

Yeah, you don't need to install git-flow yourself, in fact if you do (and choose to tell SourceTree to use your version, which you do in Preferences > Git), it's very important you have some recent updates to git-flow that ST relies on. But unless you've told ST to use your own git-flow that shouldn't be an issue (the changes ST relies on are basically just extra params and some UI-friendly behaviour, no imcompatible changes).

So the fact that you can get to that dialog at all means you have a git-flow config in your repo as expected. The only thing I can think of is that git-flow doesn't know that you're using the 'feature/' prefix. Does the .git/config inside your repo say in the [gitflow "prefix"] section that "feature = feature/" ?

Jan Mueller October 21, 2012

Hi,

yes, that prefix is there. Here's the content of the config file:

[core]
repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git@bitbucket.org:muellerj/xxxxxxxx.git [branch "master"] remote = origin merge = refs/heads/master [gitflow "branch"] master = master develop = RT-438 [gitflow "prefix"] feature = feature/ release = release/ hotfix = hotfix/ support = support/ versiontag = [branch "feature/TEST"] remote = origin merge = refs/heads/feature/TEST

stevestreeting
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.
October 22, 2012

OK, I think the problem is that your 'develop' branch is configured to be 'RT-438', but you have no such local branch. git-flow can't work like that, you must have manually deleted the branch afterwards or something. You can't finish a feature because there is no develop branch for it to merge back into! I should have spotted that you had too few local branches for git-flow in your original screenshot.

The normal branch name for develop is 'develop', so it would be best to create a develop branch (presumably at master), change your gitflow config so that 'develop = develop', and then it will work.

For a review of what exactly master & develop do, you might want to check out my blog post: http://blog.sourcetreeapp.com/2012/08/01/smart-branching-with-sourcetree-and-git-flow/

0 votes
stevestreeting
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.
October 14, 2012

I've logged this for investigation here: https://jira.atlassian.com/browse/SRCTREE-1230

0 votes
Dinky Pumpkin
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 13, 2012


Using OSX 10.8.2, SourceTree 1.5.4, embedded git and git-flow:

The git-flow operation mentioned above (finish feature with rebase), now produces this error:

Will try to rebase 'testfeature'...
git: 'rebase' is not a git command. See 'git --help'.
Finish was aborted due to conflicts during rebase.
Please finish the rebase manually now.
When finished, re-run:
    git flow feature finish 'testfeature' 'develop'

I used the test case from the associated bug report:

https://jira.atlassian.com/browse/SRCTREE-1183

Steps:

  1. unpack the test repo and import into SourceTree
  2. check out feature/testfeature
  3. run Git Flow -> Finish Current for Feature: testfeature.
  4. check "Rebase on development" and click "OK"

Of course, I see the same problem in my own repos as well.

Perhaps the cause (additions to PATH required) is the same? External Git + external git-flow works fine, e.g., git flow feature finish -r testfeature.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events