Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.gitconfig alias function call

Tags:

git

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.

like image 222
Amir Afghani Avatar asked Nov 30 '25 23:11

Amir Afghani


1 Answers

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

like image 68
sehe Avatar answered Dec 02 '25 13:12

sehe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!