php cygwin 吗?如何shell_exec
好吧,我知道这很愚蠢,但至少我在尝试:)不知
$result = shell_exec('C:/cygwin/bin/bash.exe /c --login -i git');
var_dump($result);
怎的,我无法从 cygwin 获得 git 命令,有人吗?
Adam Ramadhan
编辑*
它应该给出
用法:git [--版本] [--exec-path[=GIT_EXEC_PATH]] [--html-路径] [-p|--分页|--无分页器] [--无替换对象] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] 命令 [ARGS]
最常用的git命令 分别是:add 添加文件内容 到索引平分查找依据 二分查找的变化 引入了一个bug分支列表, 创建或删除分支结账 检查分支或路径 工作树克隆 克隆 a 存储库到新目录
commit 记录更改 存储库 diff 显示更改 提交之间、提交和工作之间 树等获取下载 来自另一个的对象和引用 存储库 grep 打印行 匹配模式初始化
创建一个空的 git 存储库或 重新初始化现有的一个日志
显示提交日志合并加入 两个或多个发展历史 一起 mv 移动或重命名 文件、目录或符号链接
拉取并合并 另一个存储库或本地分支
推动更新远程参考 与关联对象变基
转发端口本地承诺 更新了上游头重置
将当前 HEAD 重置为指定的 state rm 从中删除文件 工作树和索引
显示 显示各种类型 对象状态 显示工作状态 树状态标签创建, 列出、删除或验证标签对象 与GPG签约有关更多信息,请参阅“git help COMMAND” 有关特定命令的信息。
作为值
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 ?
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]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
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
Create an empty git repository or
reinitialize an existing one log
Show commit logs merge Join
two or more development histories
together mv Move or rename
a file, a directory, or a symlink
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
show Show various types of
objects status Show the working
tree status tag Create,
list, delete or verify a tag object
signed with GPGSee 'git help COMMAND' for more
information on a specific command.
as the value
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
-i
启动交互式 shell,您不希望/c
可能无法-c command
运行命令,您有/c --login
c:\\cygwin\\bin\\git.exe
,或 git 的完整路径。-i
starts an interactive shell, you don't want that/c
does probably not work-c command
to run a command, you have/c --login
c:\\cygwin\\bin\\git.exe
, or the complete path to git.