作業ディレクトリのCDを〜/ .bashrcに挿入すると、WindowsのGitBashショートカットに文句が表示されました。
WARNING: Found ~/.bashrc but no ~/.bash_profile, ~/.bash_login or ~/.profile.
This looks like an incorrect setup.
A ~/.bash_profile that loads ~/.bashrc will be created for you.
したがって、gitはこの.bash_profileを作成しました:
$ cat ~/.bash_profile
# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
どちらが仕事をしますか。
または、.bashrcを再度削除して、cdコマンドを.bash_profileに配置することもできます。
$ rm ~/.bashrc
$ echo "cd Source/Repos" >~/.bash_profile
$ cat ~/.bash_profile
cd Source/Repos
これが完了したら、ウィンドウを閉じてデスクトップショートカットを使用して再度開くと、プロンプトに、現在地が目的の場所にあることが示されます。これが私の場合のようです。
Administrator@raptor1 MINGW64 ~/Source/Repos
$