How to detach “git gui” started in “Git bash” on Windows?

后端 未结 5 1586
南笙
南笙 2021-02-06 05:22

For example,

  1. I start \"git bash\";
  2. I navitage to certian directory;
  3. I start git gui&;
  4. I close the console window or pre
5条回答
  •  醉酒成梦
    2021-02-06 06:22

    Based on Antonio's answer I have figured out the following recipe:

    cmd //c start //D "C:\Program Files\Git\bin" "wish.exe" "C:\Program Files\Git\libexec\git-core\git-gui"
    

    It works, as can be tested by pressing Ctrl-D in the shell. The shell closes properly and git gui continues to work.

    Drawback: this solution ignores the current directory and opens git gui in the C:\Program Files\Git\bin directory, not in the current directory.

    One may argue that git gui on Windows remembers recent repositories so it's only a click away. True, but the question is: how to get a detached git gui in the current directory...

    I have tried a few variants to fix the drawback, but nothing truly satisfying.

    The ones below always ask what to open git gui with. Choosing "C:\Program Files\Git\bin\wish.exe" in the file selector works but has to be done every time.

    cmd //c start //D "E:\\escapedwindowsstyle\\path\\to\\my\\git\\repo\\" "C:\\Program Files\\Git\\bin\\wish.exe" "C:\\Program Files\\Git\\libexec\\git-core\\git-gui"
    
    cmd //c start "C:\\Program Files\\Git\\bin\\wish.exe" "C:\\Program Files\\Git\\libexec\\git-core\\git-gui"
    

    Can anyone understand what happens and/or improve on that ?

提交回复
热议问题