简体   繁体   English

PHP的cygwin的? 如何shell_exec

[英]php cygwin ? how to shell_exec

ok i know this is stupid but atleast im trying :) 好吧,我知道这很愚蠢,但至少我正在尝试:)

$result = shell_exec('C:/cygwin/bin/bash.exe /c --login -i git');
var_dump($result);

somehow i cant get git command from cygwin, anyone ? 不知何故我无法从cygwin获得git命令,有人吗?

Adam Ramadhan 亚当·拉玛丹(Adam Ramadhan)

edit* 编辑*

it should give 它应该给

usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS] 用法:git [--version] [--exec-path [= GIT_EXEC_PATH]] [--html-path] [-p | --paginate | --no-pager] [--no-replace-objects] [ --bare] [--git-dir = GIT_DIR] [--work-tree = GIT_WORK_TREE] [--help]命令[ARGS]

The most commonly used git commands are: add Add file contents to the index bisect Find by binary search the change that introduced a bug branch List, create, or delete branches checkout Checkout a branch or paths to the working tree clone Clone a repository into a new directory 最常用的git命令是:add将文件内容添加到bisect索引中通过二进制查找来查找引入错误分支的更改列出,创建或删除分支签出签出工作树克隆的分支或路径将存储库克隆到新目录
commit Record changes to the repository diff Show changes between commits, commit and working tree, etc fetch Download objects and refs from another repository grep Print lines matching a pattern init commit记录对存储库diff的更改,显示提交,提交和工作树之间的更改,等等从另一个存储库grep下载对象和引用grep打印与模式init匹配的行
Create an empty git repository or reinitialize an existing one log 创建一个空的git存储库或重新初始化现有的一个日志
Show commit logs merge Join two or more development histories together mv Move or rename a file, a directory, or a symlink 显示提交日志合并将两个或多个开发历史合并在一起mv移动或重命名文件,目录或符号链接
pull Fetch from and merge with another repository or a local branch 从另一个存储库或本地分支中提取并合并
push Update remote refs along with associated objects rebase 推送更新远程引用以及关联的对象变基
Forward-port local commits to the updated upstream head reset 前向端口本地提交到更新的上游头重置
Reset current HEAD to the specified state rm Remove files from the working tree and from the index 将当前HEAD重置为指定状态rm从工作树和索引中删除文件
show Show various types of objects status Show the working tree status tag Create, list, delete or verify a tag object signed with GPG show显示各种类型的对象状态显示工作树状态标签创建,列出,删除或验证使用GPG签名的标签对象

See 'git help COMMAND' for more information on a specific command. 有关特定命令的更多信息,请参见“ git help命令”。

as the value 作为价值

  • -i starts an interactive shell, you don't want that -i启动一个交互式shell,您不需要
  • /c does probably not work /c可能无法正常工作
  • use -c command to run a command, you have /c --login 使用-c command运行命令,您具有/c --login
  • try c:\\\\cygwin\\\\bin\\\\git.exe , or the complete path to git. 尝试c:\\\\cygwin\\\\bin\\\\git.exe或git的完整路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM