Windows的Git:.bashrc或Git Bash Shell的等效配置文件 [英] Git for Windows: .bashrc or equivalent configuration files for Git Bash shell
问题描述
我刚刚安装了Windows版Git,很高兴看到它安装了Bash.
I've just installed Git for Windows and am delighted to see that it installs Bash.
我想以与Linux下相同的方式自定义外壳程序(例如,为ls -l
设置ll
之类的别名),但是我似乎找不到.bashrc
或等效的配置文件.
I want to customise the shell in the same way I can under Linux (e.g. set up aliases like ll
for ls -l
), but I can't seem to find .bashrc
or equivalent configuration files.
我应该编辑什么?
推荐答案
在~/.bashrc
下创建一个.bashrc
文件,然后离开.对于~/.gitconfig
类似.
Create a .bashrc
file under ~/.bashrc
and away you go. Similarly for ~/.gitconfig
.
~
通常是您的C:\Users\<your user name>
文件夹.在Git Bash终端中键入echo ~
会告诉您该文件夹是什么.
~
is usually your C:\Users\<your user name>
folder. Typing echo ~
in the Git Bash terminal will tell you what that folder is.
如果无法创建文件(例如,运行Windows),请运行以下命令:
If you can't create the file (e.g. running Windows), run the below command:
copy > ~/.bashrc
该窗口将输出一条错误消息(未找到命令),但是将创建文件并准备好进行编辑.
The window will output an error message (command not found), but the file will be created and ready for you to edit.
这篇关于Windows的Git:.bashrc或Git Bash Shell的等效配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!