首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试运行扩展GIT的脚本

尝试运行扩展GIT的脚本
EN

Stack Overflow用户
提问于 2016-01-07 20:21:31
回答 2查看 50关注 0票数 1

我已经将以下代码保存为.sh文件,并从我的根目录执行它:https://gist.github.com/emiller/6769886

有几个错误:

代码语言:javascript
复制
script.sh: line 65: conditional binary operator expected
script.sh: line 65: syntax error near `=~'
script.sh: line 65: `while [[ $1 =~ ^\- ]]; do'

然后,当我运行git-rewrite-history命令时,我收到一个错误:

代码语言:javascript
复制
'git-rewrite-history' is not recognized as an internal or external command,
operable program or batch file.

非常感谢你的帮助,这里有0 linux的经验。

谢谢。

编辑-我正在使用windows中的bash,这可能与这个问题有关。将尝试在Linux发行版上运行。

EN

回答 2

Stack Overflow用户

发布于 2016-01-07 21:12:52

'git-rewrite-history‘未被识别为内部或外部命令、可操作程序或批处理文件。

您需要设置脚本执行权限:

代码语言:javascript
复制
chmod 777 path/to/git-rewrite-history
票数 1
EN

Stack Overflow用户

发布于 2016-01-20 20:39:26

名为git-rewrite-history的bash脚本(即使是在Windows上)必须使用以下命令执行:

代码语言:javascript
复制
git rewrite-history

任何名为git-xxx的脚本都可以这样调用(git xxx),只要git-xxx位于%PATH%环境变量引用的文件夹中。

bash脚本将在msys2 bash git会话中执行,即使从简单的Windows CMD shell会话调用也是如此。

你根本不需要Cygwin。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34655014

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档