简体   繁体   English

使用 git bash 在 Windows 7 中打开 html 文件

[英]Opening an html file in windows 7 using git bash

I'm trying to repeat the steps from this video .我正在尝试重复此视频中的步骤。

I find that the git bash, in my Windows 7 (x64), doesn't accept the command atom for opening an html file.我发现我的 Windows 7 (x64) 中的 git bash 不接受用于打开 html 文件的命令atom I created the html file using the touch command:我使用touch命令创建了 html 文件:

I tried so many sites on how to open a file of a text editor from git bash , but nothing works.我尝试了很多关于如何从 git bash 打开文本编辑器文件的网站,但没有任何效果。

Here's some things to try:这里有一些事情可以尝试:

  1. Add the path to atom.exe to your environment variables将 atom.exe 的路径添加到您的环境变量中
  2. Associate atom with all git operations, run: git config --global core.editor "atom --wait" (when you use git bash to edit, this tells it to always use atom)将 atom 与所有 git 操作关联,运行: git config --global core.editor "atom --wait" (当您使用 git bash 进行编辑时,这告诉它始终使用 atom)
  3. Add an alias in git: git config --global alias.edit "! atom" and now you can edit any file by calling: git edit [filename]在 git 中添加别名: git config --global alias.edit "! atom"现在你可以通过调用来编辑任何文件: git edit [filename]

Here is another SO post with something very similar (I think) to your question: Open Atom editor from git shell .这是另一个与您的问题非常相似(我认为)的 SO 帖子: Open Atom editor from git shell

However, it's difficult to know what your problem is without more detail.但是,如果没有更多细节,很难知道您的问题是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM