.gitconfig别名函数调用

Ami*_*ani 3 git

我在.gitconfig中定义了以下别名:

[alias]
    teamcity = ! tc
Run Code Online (Sandbox Code Playgroud)

tc是我在我的.bashrc文件中定义的shell函数.出于某种原因,我收到以下错误:

[aafghani-03:~/git/workday amirafghani(master)]$ git teamcity
 tc: tc: command not found
Run Code Online (Sandbox Code Playgroud)

有谁知道我能做些什么来解决这个问题?我想尽可能将函数保存在我的.bashrc 文件中.

seh*_*ehe 6

就这样吧

git config alias.teamcity '!bash -ic tc'
Run Code Online (Sandbox Code Playgroud)

当别名在bash启动文件之外定义时,这将不起作用.但你清楚地说明它在.bashrc中,所以你很好