Using IntelliJ as Git Bash Core Editor on Windows

Answered

On GitHub, there is a page about associating text editor programs with Git Bash on Windows:
https://help.github.com/en/articles/associating-text-editors-with-git

This aims to replace vi in the command line with a text editor program, so using Git Bash in the command line would open the text editor for modifying messages for `git commit`, `git rebase -i`, ect.

Currently, I have this set up with VS Code (seemingly made easy with the `code` command) like so:
https://www.mking.net/blog/using-vscode-as-the-default-git-editor
However, most of the developers on my team are switching their workflow from VS Code to IntelliJ completely, so I'm looking to do the same for better support and pair programming. This is the last of desired functionality I need to replace in my migration to IntelliJ such that I can uninstall VS Code.
Is it possible to associate IntelliJ as the text editor program to open for Git Bash in the command line?

2
5 comments

Not sure exactly if this is what you're asking, but you can configure intellij's terminal to use the git bash shell? I'm assuming you must be on windows?

should be something like this:

if so.

1
Avatar
Permanently deleted user

Thanks Karl! I have already managed to get this working. What I'm hoping to do goes a little farther:

I'd like to be able to run `git commit` in my integrated terminal (or really, any git terminal), then Git Bash would be configured to open IntelliJ as the editor for my commit message rather than a command line editor like vi.

The links in my OP document how you can do this with Atom, Sublime, NotePad++ or VS Code, but it would be awesome if I can stay integrated in IntelliJ

0

Yeah, I figured it was more involved then my terminal configuration.... sorry, not sure how to do what you're after here.

0

I would like to know if there is a solution to this in 2022

2

Please sign in to leave a comment.