Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Terminal git rebase x运行别名_Terminal_Zsh_Rebase_Arcanist - Fatal编程技术网

Terminal git rebase x运行别名

Terminal git rebase x运行别名,terminal,zsh,rebase,arcanist,Terminal,Zsh,Rebase,Arcanist,我在执行git rebase-I pick hash commit_message x alias_name 错误: Executing: alias_name error: cannot run alias_name: No such file or directory warning: execution failed: alias_name You can fix the problem, and then run git rebase --continue 如果我在终端上运行

我在执行git rebase-I

pick hash commit_message
x alias_name
错误:

Executing: alias_name
error: cannot run alias_name: No such file or directory
warning: execution failed: alias_name
You can fix the problem, and then run

  git rebase --continue


如果我在终端上运行别名,它将按预期工作。

Git不知道您定义的任何别名或shell函数,因此它开始执行给定命令的shell也不知道它们。您需要生成一个包含别名定义的文件,然后根据需要在命令本身中启用别名扩展

pick hash commit_message
x source some_file; shopt -s expand_aliases; alias_name
其中
some_文件
包含别名定义

但是,我怀疑这仍然会失败,因为所讨论的shell在实际生成文件或启用别名扩展之前,会尝试在完整的命令行中扩展别名,从而使
alias\u name
留下未定义的命令名。但是,用函数替换别名应该可以工作

在可访问的文件中,执行以下操作:

x source some_file; func_name

未工作,此处错误输出:``正在执行:source~/.zshrc;grbi_rev source~/.zshrc;grbi_版本:1:source~/.zshrc;grbi_版本:源:未找到源~/.zshrc;grbi_版本:1:source~/.zshrc;grbi_rev:grbi_rev:not found警告:执行失败:source~/.zshrc;grbi_rev`````./zshrc文件grbi_rev(){USER=T04435~/path_to_file/phab arg1 arg2}``我正在尝试您的答案的更多变体,但似乎没有任何效果。很抱歉,格式化。
func_name () {
  the_script.py arg1 arg2
}
x source some_file; func_name