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
then I have this dialog
But when I confirm, I have the error
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
.
If I try to do
then I have this dialog
But when I confirm, I have the error
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.
/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.
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.
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.
© 2022 - 2024 — McMap. All rights reserved.