Windows的Git:.bashrc或Git Bash Shell的等效配置文件 [英] Git for Windows: .bashrc or equivalent configuration files for Git Bash shell

查看:263
本文介绍了Windows的Git:.bashrc或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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆