如何在 Git Bash 中更改 Atom 的默认保存位置?

问题描述

我最近安装了 Git Bash 并将 Atom 设置为我的认编辑器 $ git config --global core.editor "atom --wait"

当我尝试在 Git Bash 中创建或编辑 .py 文件时,Atom 打开正常,但随后出现此错误(如下)并且我无法使用 -add 或 commit 命令。有截图。

enter image description here

$ 试图在已经关闭或相对的渲染器窗口中调用函数 此处提供的功能:对象。 (C:\Users\Maria\AppData\Local\atom\app-1.55.0\resources\app.asar\node_modules\github\lib\worker.js:79:22) 远程事件名称:崩溃、销毁

以下是我的一些数据。

enter image description here

我发现我的错误是由 Atom 将我的新 py 文件保存在此目录中而不是我专用的 Git 存储库中引起的..

例如,free_memory.py 被保存在 C:\Users\Maria\AppData\Local\atom\app-1.55.0

enter image description here

代替 C:\Users\Maria\Git_course\scripts

enter image description here

我已将 ';C:\Users\Maria\AppData\Local\atom\bin' 添加到我的环境变量路径...

如何将这些文件保存在 C:\Users\Maria\Git_course\scripts(使其成为认保存位置)? 我也很困惑为什么 Atom 有两个 .exe 文件一个在 Atom 文件夹中,另一个在 Atom 主文件夹中的 app-1.55 文件夹中?

enter image description here

如何正确配置? 我使用的是 64 位 Windows 7。

感谢您的建议。

解决方法

检查这是否与atom/atom issue 19849有关

这个错误总是在我的 Windows 安装中触发,到目前为止我只找到了一种解决方法:使用 atom --wait --new-window 而不是 atom --wait

这将复制 Atom 在新窗口中打开提交消息的原始行为,而不是向现有窗口添加选项卡 - 这样我只需关闭该新窗口(就像点击 CTRL 一样简单+W 两次),而不必关闭然后重新打开项目窗口。