Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't initialise git-flow with SourceTree

My problem

In the current project I'm working on, I'm not able to initialise gitflow with SourceTree. Can you help?

My version of SourceTree is 2.7.6.

Screenshots

If I try to do

enter image description here

then I have this dialog

enter image description here

But when I confirm, I have the error

enter image description here

like image 851
Colas Avatar asked Jul 27 '18 16:07

Colas


Video Answer


2 Answers

I had exactly the same problem. I moved SourceTree to a different directory, and its path contained a space character from one of its parent directories.

As a result, the path to its internal getopt was stored by SourceTree in ~/.gitflow_export (and, indeed, rewritten at every launch) and contained that space without the required quotes.

Removing the space in the directory name solved the issue. If you move SourceTree around, make sure its path contains no space.

like image 115
BenoitW Avatar answered Sep 30 '22 05:09

BenoitW


/bin/getopt: not a valid identifier suggests an issue with getopt. There were few reported to Attlassian e.g. Is git-flow broken in Sourcetree 2.7.1?

A possible workaround to install getopt by hand as per Post installation setup:

Install GNU getopt via Homebrew:

brew install gnu-getopt

Create a ~/.gitflow_export with the content export FLAGS_GETOPT_CMD="$(brew --prefix gnu-getopt)/bin/getopt".

For git-flow versions prior to 1.4.0-dev.28

Create a ~/.gitflow_export with the content alias getopt="$(brew --prefix gnu-getopt)/bin/getopt".

If you have installed GNU getopt through other means than Homebrew, substitute $(brew --prefix gnu-getopt)/bin/getopt with the location of the GNU getopt file.

like image 28
Karol Dowbecki Avatar answered Sep 30 '22 05:09

Karol Dowbecki