gpt4 book ai didi

windows - .bash_history 不会在 Git for Windows (git bash) 中更新

转载 作者:IT王子 更新时间:2023-10-29 00:56:01 58 4
gpt4 key购买 nike

我正在使用 Windows 版 Git(版本 1.7.8-preview20111206),即使我的 HOME 文件夹中有一个 .bash_history 文件,它也不会自动更新。当我启动 Git Bash 时,我可以在历史命令中看到我手动添加到 .bash_history 文件的命令,但它不会自动更新。

我使用了 shopt -s histappend 命令来确保每次关闭 shell 时都保存历史记录,但它不起作用。

如果我手动使用 history -w 命令,那么我的文件会更新,但我想了解为什么 shopt 命令无法正常工作。

谁能告诉我为什么会发生这种行为?

最佳答案

我把这个放在我的 ~/.bash_profile

PROMPT_COMMAND='history -a'

关于windows - .bash_history 不会在 Git for Windows (git bash) 中更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10488498/

58 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com