简体   繁体   中英

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.

$ 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:

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"

this should work.

  1. start with git init wherever your project is.
  2. this should create.git folder from 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)

On Linux, write this command in Bash:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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