Answer the question
In order to leave comments, you need to log in
Why don't changes from .bashrc take effect?
Good afternoon.
I work in windows.
I am using git-bash terminal.
There is an alias in the .bashrc file. alias cp="rsync -avz -P"
I used this alias in Ubuntu, but I don't need it in Windows, so I commented it out.
I have two aliases
#alias gitlog='git log --graph --pretty=oneline --abbrev-commit --all --decorate'
164 alias gitlog='git log --pretty=format:"%h %ad | %s%d [%an] " --graph --date=short'
source ~/.bashrc
Answer the question
In order to leave comments, you need to log in
The command source ~/.bashrc
loads .bashrc again, everything is correct here, but there is a little subtlety: if alias is already set, then removing it from .bashrc will not change anything. You can draw an analogy (not entirely correct, but still) with a demon - it was launched once at the start and it exists and will exist until you finish it with your own hands. Here one of two things - either completely reload bash (which is not always desirable), or use the command unalias
.
I save and close the .bashrc file.
I write in the terminal source ~ / .bashrc
That is, the changes from .bashrc did not take effect?
judging by what is written, you don’t have the rsync command, you need
to do $ whereis rsync
and if the output looks like this:
then everything is fine and rsync installed then
$ unalias cp || alias cp='/usr/bin/rsync -avz -P'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question