.gitconfig别名函数调用 [英] .gitconfig alias function call
本文介绍了.gitconfig别名函数调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在.gitconfig中定义了以下别名:
[别名]
teamcity =! tc
tc
是我定义的shell函数在我的 .bashrc
文件中。出于某种原因,我收到以下错误:
pre $ [aafghani-03:〜/ git / workday amirafghani(master)] $ git teamcity
tc:tc:command not found
任何人都知道我能做些什么来解决这个?如果可能的话,我试图将函数保存在 .bashrc
文件中。
解决方案
让它像这样
git config alias.teamcity'!bash -ic tc'
当别名在bash启动文件之外定义时,这将不起作用。但是你清楚地声明它在.bashrc中,所以你很好
I have defined the following alias in my .gitconfig:
[alias]
teamcity = ! tc
tc
is a shell function I defined in my .bashrc
file. For some reason, I get the following error:
[aafghani-03:~/git/workday amirafghani(master)]$ git teamcity
tc: tc: command not found
Anyone know what I can do to solve this? I'm trying to keep the function in my .bashrc
file if possible.
解决方案
Make it like so
git config alias.teamcity '!bash -ic tc'
This won't work when the alias is defined outside the bash startup files. But you clearly state it's in .bashrc, so you're good
这篇关于.gitconfig别名函数调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文