22
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Windows Git 2.6.1で~/.bashrcがGit Bashから読み込まれるようにする

Last updated at Posted at 2015-09-19

新しいWindows PCにGitを入れたら、環境変数HOMEを設定しているにもかかわらず、Git Bash起動時にホームディレクトリ配下の.bashrcが読み込まれなかった。

毎回$ source .bashrcを打つのでもいいが、bash.bashrcに以下のようなif文を追加して、ホームディレクトリ配下の.bashrcも起動時にロードされるようにするほうが楽だと思う。

  • C:\Program Files\Git\etc\bash.bashrc
    (11行目くらいの# System-wide bashrc fileコメントの下に追加した例)
bash.bashrc
# System-wide bashrc file
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
22
15
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
22
15

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?