我正在尝试查找有关msysgit sh.exe命令的一些文档。
例如,我知道启动 git bash 会话的--login
标志,但我会知道其他可能性。
我已经查看了互联网,但找不到列出所有可能参数的任何地方。
> .sh.exe --help
GNU bash, version 3.1.0(1)-release-(i686-pc-msys)
Usage: ".../Git/bin/sh.exe" [GNU long option] [option] ...
".../Git/bin/sh.exe" [GNU long option] [option] script-file ...
GNU long options:
--debug
--debugger
--dump-po-strings
--dump-strings
--help
--init-file
--login
--noediting
--noprofile
--norc
--posix
--protected
--rcfile
--restricted
--verbose
--version
--wordexp
Shell options:
-irsD or -c command or -O shopt_option (invocation only)
-abefhkmnptuvxBCHP or -o option
Type `".../Git/bin/sh.exe" -c "help set"' for more information about shell options.
Type `".../Git/bin/sh.exe" -c help' for more information about shell builtin commands.
Use the `bashbug' command to report bugs.
另请参阅GNU网站和bash的手册。
来自 git 命令行工具套件 https://git-scm.com/download/win 的sh.exe
本身就是一个 Windows 可执行文件,但可以执行 linux 命令行和 linux shell 脚本。
- 首先,应设置路径,例如:
set PATH=D:ProgramsGitcmdbin;%PATH%
- 也许一些环境变量适合构建一个
$HOME
:HOMEDRIVE和HOMEPATH。 -
两者都可以在批处理文件中正确完成。
sh.exe
如果没有参数,请打开 shell 窗口,尝试键入"ls"、"whoami"或"git"等命令。它应该运行。
sh.exe -x -c "command arg1 'arg2 with spaces' arg3"
调用单个 Linux 命令,例如
sh.exe -x -c "git status"
sh.exe -x "path/to/scriptfile"
执行该脚本文件。
您可以在 http://www.vishia.org/Git/html/Gitcmd.html 中阅读更多内容