Closed Shagrat2 closed 3 weeks ago
This is because macOS limits the PATH environment variable that GUI applications can access. You can do as following steps to resolve the problem.
$ which git-flow
/opt/homebrew/bin/git-flow
PATH
environment for GUI application.
$ launchctl setenv PATH $PATH:/opt/homebrew/bin
Not work
Did you restart the SourceGit after running launchctl setenv
command?
Try to run:
$ launchctl getenv PATH
Check if the PATH
environment have been set properly
Oh, I'm sorry. I know what's wrong. You need run killall Dock
after launchctl
command, and then restart the SourceGit.
Yes. Restart user session
% launchctl getenv PATH
/opt/homebrew/opt/openjdk@17/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Little Snitch.app/Contents/Components:/usr/local/go/bin:/Users/ivan/workspace/golang/bin:/opt/homebrew/bin
Yes. Restart user session
% launchctl getenv PATH /opt/homebrew/opt/openjdk@17/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/Applications/Little Snitch.app/Contents/Components:/usr/local/go/bin:/Users/ivan/workspace/golang/bin:/opt/homebrew/bin
Still not work after killall Dock
?
killall Dock - Does not give a result Restart computer - Does not give a result
I'm using macOS 14.5 M3. I have no problem after running launchctl setenv
...
You can try to add LSEnvironment
key to the Info.plist
of this app. Remember replace the value of PATH
with yours.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIconFile</key>
<string>App.icns</string>
<key>CFBundleIdentifier</key>
<string>com.sourcegit-scm.sourcegit</string>
<key>CFBundleName</key>
<string>SourceGit</string>
<key>CFBundleVersion</key>
<string>8.15.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.12</string>
<key>LSEnvironment</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/homebrew/bin</string>
</dict>
<key>CFBundleExecutable</key>
<string>SourceGit</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>8.15</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
I've add /opt/homebrew/bin
and /opt/homebrew/sbin
into the plist. You can try the latest release.
Worked
Ver: 8.15 OS: MacOs 14.5 M2
GitFlow Start reliase show error:
git: 'flow' is not a git command. See 'git --help'. The most similar commands are reflog show
brew: git-flow 0.4.1_1 is already installed