git help in Windows command prompt

后端 未结 4 1477
失恋的感觉
失恋的感觉 2021-02-19 19:13

The git help command on Windows (msysgit distribution) spawns web browser each time I run it. I tried git help -m which reports \"No

4条回答
  •  梦谈多话
    2021-02-19 19:38

    World's most overengineered workaround for this problem: use WSL

    (that is, unless you already are a WSL user, in which case it's merely an ordinary workaround)

    1. Install one of the linux distros via Windows Store
    2. Go in and ensure it has the git package installed
    3. From the Windows command line, bash -c 'git help fetch' etc.

    Here's an alias for that last one:

    [alias]
        hep = "!f() { $SYSTEMROOT/System32/bash -c \"git help $1\"; }; f"
    

    (And no you can't override git built-ins, but you can make a shell command to intercept and reroute help.)

提交回复
热议问题