适用于Windows的Git:.bashrc或用于Git Bash shell的等效配置文件 [英] Git for Windows: .bashrc or equivalent config files for Git Bash shell

查看:375
本文介绍了适用于Windows的Git:.bashrc或用于Git Bash shell的等效配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚为Windows安装了 Git ,并高兴地看到它安装了 Bash

我想以我在Linux下的方式来定制shell(例如,为 ll 设置别名 ls -l <​​/ code>),但我似乎无法找到 .bashrc 或同等配置。



我应该编辑什么?

解决方案

创建一个<$在〜/ .bashrc 下的c $ c> .bashrc 文件,然后离开。同样,对于〜/ .gitconfig



是通常是您的 C:\ Users \<您的用户名> 文件夹。在git bash终端中键入 echo〜会告诉你该文件夹是什么。



如果你不能创建(例如运行Windows),运行以下命令:

  copy> 〜/ .bashrc 

该窗口将输出一条错误信息(找不到命令),但文件将会创建并准备好进行编辑。


I've just installed Git for Windows and delighted to see that it installs Bash.

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 config.

What should I be editing?

解决方案

Create a .bashrc file under ~/.bashrc and away you go. Similarly for ~/.gitconfig.

~ is usually your C:\Users\<your user name> folder. Typing echo ~ in the git bash terminal will tell you what that folder is.

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天全站免登陆