简体   繁体   English

使用git bash打开PyCharm的路径?

[英]Path for opening PyCharm using git bash?

I have tried the following lines in GitHub bash. I need to set path for PyCharm in Git Bash so that PyCharm should open from the bash.我在 GitHub bash 中尝试了以下几行。我需要在 Git Bash 中设置 PyCharm 的路径,以便 PyCharm 应该从 bash 打开。

$ git config core.editor "PyCharm"
fatal: not in a git directory

$ git config core.editor "PyCharm --wait"
fatal: not in a git directory

在此处输入图像描述

To use PyCharm as the default editor in Bash (on Windows), you need to find where the PyCharm.exe is saved and copy the path to this.exe into the following command in Bash: To use PyCharm as the default editor in Bash (on Windows), you need to find where the PyCharm.exe is saved and copy the path to this.exe into the following command in Bash:

git config --global core.editor "'<path to PyCharm.exe>' --wait"

The command that you are running is trying to set the editor for a specific repository, and because you are not in one it tells you accordingly.您正在运行的命令正在尝试为特定存储库设置编辑器,并且因为您不在一个存储库中,它会相应地告诉您。 To set the editor globally, include the --global flag in your command like git config --global core.editor "PyCharm"要全局设置编辑器,请在命令中包含--global标志,例如git config --global core.editor "PyCharm"

this should work.这应该有效。

  1. start with git init wherever your project is.无论您的项目在哪里,都从git init开始。
  2. this should create.git folder from git.这应该从 git 创建.git 文件夹。
  3. now run your commands.现在运行你的命令。

the idea is to run these commands where ever.git is present ( that in your repostiroy which is created since once you run git init)这个想法是在 ever.git 存在的地方运行这些命令(在你运行 git init 后创建的 repostiroy 中)

On Linux, write this command in Bash:在Linux上,在Bash中写入这条命令:

git config --global core.editor "pycharm-community"

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

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