VD18421
VD18421

Reputation: 295

git bash shell .bashrc not working every time

I have a .git directory in my Dropbox, to store data for my website. In the directory, I have a .bashrc file, like this:

directory and .bashrc

When I type this into the bash terminal, it echo's

$ source .bashrc
my login

but when I restart terminal, it echo's nothing. I have to source it again.

I've read a few posts about this issue, about having to source it again and again but they said that if you do it to .bashrc it will work everytime. Mine doesn't. Where am I messing up?

Upvotes: 0

Views: 262

Answers (1)

paxdiablo
paxdiablo

Reputation: 881323

When bash goes looking for its startup files, it generally looks for .bashrc in your home directory (where it currently isn't).

If you want to source a separate .bashrc file, probably the easiest solution is to put something like this into your actual one (the one that bash will run), $HOME/.bashrc:

otherOne="/somewhere/else/.bashrc"
if [[ -x "${otherOne}" ]] ; then
    . "${otherOne}"
fi

Upvotes: 2

Related Questions