Can't initialise git-flow with SourceTree
Asked Answered
O

4

6

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

Overbid answered 27/7, 2018 at 16:8 Comment(0)
B
5

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.

Berkeleianism answered 4/11, 2018 at 16:30 Comment(2)
Thanks to Frank L. for helping on this. :)Berkeleianism
The same for me: remove all spaces from path for SourceTree appChaves
C
1

/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.

Catchpole answered 3/8, 2018 at 14:37 Comment(2)
It didn't work. And ` ~/.gitflow_export` is reinitialized to another value whenever I launch Sourcetree.Overbid
Same thing that happened to @Overbid also happened to me worked once, then overwrote the ` ~/.gitflow_export`. thanks for the reply :)Nemathelminth
N
1

Apologies in advance. Managed to resolve the issue for myself with a hack. My solution was based on the above observations. (Which I tried) The issue was the space in the name Sourcetree 3 (in my case) In the Applications folder I selected the Icon for launching the application and removed the space. Gitflow is now working. Sorry if you are horrified by my crude hack but it works and I do not have more time to invest into this issue.

Nemathelminth answered 5/11, 2021 at 15:3 Comment(0)
B
0

In my case, SourceTree was overriding the getopt command with it's custom one by creating a file in my home directory. After deleting SourceTree that setting was challenging to find.

I needed to remove the ~/.gitflow_export file.

Before you delete it, double-check that nothing is in there that you still need.

Buckboard answered 27/6 at 12:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.