sourcegit-scm / sourcegit

Windows/macOS/Linux GUI client for GIT users
MIT License
616 stars 66 forks source link

GitFlow Start reliase show error #168

Closed Shagrat2 closed 3 weeks ago

Shagrat2 commented 1 month ago

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

love-linger commented 1 month 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.

  1. Get the location where your git-flow installed.
    $ which git-flow
    /opt/homebrew/bin/git-flow
  2. Set the PATH environment for GUI application.
    $ launchctl setenv PATH $PATH:/opt/homebrew/bin
Shagrat2 commented 1 month ago

Not work 2024-06-05_13-24-46

love-linger commented 1 month ago

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

love-linger commented 1 month ago

Oh, I'm sorry. I know what's wrong. You need run killall Dock after launchctl command, and then restart the SourceGit.

Shagrat2 commented 1 month ago

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
love-linger commented 1 month ago

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 ?

Shagrat2 commented 1 month ago

killall Dock - Does not give a result Restart computer - Does not give a result

love-linger commented 1 month ago

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>
love-linger commented 3 weeks ago

I've add /opt/homebrew/bin and /opt/homebrew/sbin into the plist. You can try the latest release.

Shagrat2 commented 3 weeks ago

Worked