msysgit sh.exe arguments

后端 未结 2 1235
北荒
北荒 2021-02-19 23:22

I am trying to find some documentation about msysgit sh.exe command.

For instance I am aware of the --login flag to launch a git bash session but I would to

2条回答
  •  迷失自我
    2021-02-20 00:02

    The sh.exe from the git command line tool suite https://git-scm.com/download/win is a Windows executable by itself but can execute linux command lines and linux shell scripts.

    • Firstly the path should be set, for example: set PATH=D:\Programs\Gitcmd\bin;%PATH%
    • Maybe some environment variables are proper to build a $HOME: HOMEDRIVE and HOMEPATH.
    • both can be done proper in a batch file.

      sh.exe 
      

      without arguments opens a shell window, try to type commands like 'ls', 'whoami' or 'git'. It should run.

      sh.exe -x -c "command arg1 'arg2 with spaces' arg3" 
      

      invokes a single linux command, for example sh.exe -x -c "git status"

      sh.exe -x "path/to/scriptfile"
      

      executes that scriptfile.

    You can read more in http://www.vishia.org/Git/html/Gitcmd.html

提交回复
热议问题