Phpstorm Git Bash



If you don’t use Git and Jetbrains’ fabulous editor, PhpStorm, this article probably won’t interest you. Likewise, if you use both and are used to using the Git features inside PhpStorm, this won’t be much use to you, although you can do other things in Git Bash like using SSH connections, copying files, running Grep, or issuing Composer or Perl commands. Of course you can also use it as a terminal.

Git in Bash If you’re a Bash user, you can tap into some of your shell’s features to make your experience with Git a lot friendlier. Git 2.10+ Node.js 8+, npm 6+ Docker 18.03+ PHP 7+ and Composer 1.4+ Windows users: use Git Bash¶ Git Bash (part of Git for Windows) is required on Windows, please use it instead of cmd.exe / PowerShell for both interactive sessions and as your npm script shell. / Setting up a Self Hosted Git server for IntelliJ PhpStorm on a Synology NAS Drive. Further down we will create a small bash script that will run the commands above for us, but it is a good thing to know what is going on, and how to create a git repo without the helper script. Browse other questions tagged bash git phpstorm or ask your own question. The Overflow Blog Podcast 320: Covid vaccine websites are frustrating. This does no longer work with Win10 and PHPStorm 2018.2.6 The bash window just pops up outside the IDE and closes imediately again. – macbert Mar 21 '19 at 11:07 6 If you're using Git For Windows, make sure not to use C:Program FilesGitgit-bash.exe, but C:Program FilesGitbinbash.exe - otherwise the command prompt will open in a.

Phpstorm Git Bash Plugin

I’m used to using the Git Bash command line tool. I trust it more than I do any IDE-based Git tool. The command line tool also allows you to quickly and safely perform the more complex operations necessary to recover from the disasters that will eventually strike when you’re working in the wee hours of the morning.

Of course I already had a Quick Start icon for the Bash shell at the bottom of my screen, so I could launch it any time, but it’s much more convenient to issue the commands in PhpStorm where the files you’ve been working on are visible. On Windows, another huge plus is that you have full copy and paste capability both ways (something I didn’t get in the Bash window launched from the Windows desktop). You can copy your commit message and paste it into your changelog, for example (or vice versa).

It took me most of an evening and a lot of trial and error to make this work and Google wasn’t much help, so I thought I’d document it here for others. The liars club. These steps are for PhpStorm 8.0.1 with XAMPP on localhost under Windows Vista, so you’ll have to modify them somewhat if you’re on another platform. This assumes that you have a Git client and the Git Bash shell installed with XAMPP, though a similar process will work with cygwin.

The Terminal

I kept playing with various PhpStorm settings for Command Line Tools, since that’s what I think of Git Bash as (it looks and acts like the Windows cmd prompt). The fact is, though, that it’s a terminal client and that’s how PhpStorm thinks of it. To implement it, you have to go to:

[code language=”html”]
File -> Settings -> Tasks -> Terminal
[/code]

Once you’re there, here are the steps necessary to enable Git Bash in the Terminal dialog.

Put the following line in the Shell Path field (adjust as necessary for your platform):

Zibra fan Polyester Angle 1-7/8-in Paint Brush Model #PB100LZF A Paint Brush for Every Project You've selected your new paint color and you're ready to take on your next DIY project. Zibra's professional paintbrushes are designed specifically for your application and constructed to last. Our unique brush shapes deliver incredible paint pick up, controlled release, unmatched smoothness and effortless clean-up. Zibra paint brushes review. The Zibra round paint brush is a versatile paint brush for rounded surfaces of all sizes in need of a facelift. The round brush head not only conforms to the shape of your project, but gets in the nooks and crannies often seen on furniture legs. Pair this with the pointed round paint brush for a dynamic duo to tackle your next curvy project. Combination flat and angled head guarantees maximum paint load for long runs.

[code language=”html”]
C:Program Files (x86)Gitbinsh.exe -login -i
[/code] Seaworld restaurant menus.

The -login tells Bash to run its configuration files (more on that in the next article), and the -i tells Bash that you want interactive mode. You can add -v if you like verbose output from Bash.

As an alternative, you can click on the browse icon and navigate to the sh.exe file, wherever it is, but be sure to add the command-line options after the path.

I left all the checkboxes checked and it seems to work fine. When you’re done, click on “Apply” and then on “OK”. You may have to restart PhpStorm for this all to take effect.

At the bottom of the PhpStorm screen (bottom left on my version) you should see a “Terminal” button. When you click on it, you should see a window with the Bash prompt, followed by a cursor. If the cursor is white, your typing will be ignored until you click in the window — then it will turn black. If you don’t see that “Terminal” button, you can use the View -> Toolbars menu option or Alt-F12 to bring you the terminal window.

I prefer to have the window floating. You can select that option from the little gear icon at the upper right of the window. Clicking on the minimize icon next to the gear icon, or on the “Terminal” button will hide the window. If you click on the red X, it will close your terminal session and you’ll lose your place. You can also have multiple Bash windows open by clicking on the + symbol, which is handy if you want to repeat actions in different directories, especially since you can use copy and paste.

For more information on how to use MODX to create a web site, see my web site Bob’s Guides, or
better yet, buy my book: MODX: The Official Guide.

Looking for quality MODX Web Hosting? Look no further than Arvixe Web Hosting!

If you don't use Git and Jetbrains' fabulous editor, PhpStorm, this article probably won't interest you. Likewise, if you use both and are used to using the Git features inside PhpStorm, this won't be much use to you, although you can do other things in Git Bash like using SSH connections, copying files, running Grep, or issuing Composer or Perl commands. Of course you can also use it as a terminal.

I'm used to using the Git Bash command line tool. I trust it more than I do any IDE-based Git tool. The command line tool also allows you to quickly and safely perform the more complex operations necessary to recover from the disasters that will eventually strike when you're working in the wee hours of the morning.

Of course I already had a Quick Start icon for the Bash shell at the bottom of my screen, so I could launch it any time, but it's much more convenient to issue the commands in PhpStorm where the files you've been working on are visible. On Windows, another huge plus is that you have full copy and paste capability both ways (something I didn't get in the Bash window launched from the Windows desktop). You can copy your commit message and paste it into your changelog, for example (or vice versa).

It took me most of an evening and a lot of trial and error to make this work and Google wasn't much help, so I thought I'd document it here for others. These steps are for PhpStorm 2016.2 with XAMPP on localhost under Windows 10, so you'll have to modify them somewhat if you're on another platform. This assumes that you have a Git client and the Git Bash shell. I use the shell installed with Git (installed from here). A similar process should work with cygwin or other shells.

The Terminal

I kept playing with various PhpStorm settings for Command Line Tools, since that's what I think of Git Bash as (it looks and acts like the Windows cmd prompt). The fact is, though, that it's a terminal client and that's how PhpStorm thinks of it. To implement it, you have to go to:

Phpstorm Git Bash

Once you're there, here are the steps necessary to enable Git Bash in the Terminal dialog.

Put the following line in the Shell Path field (adjust as necessary for your platform):

Phpstorm Git Bash

If you are using the 64-bit version of Git, the path is different:

Don't forget the quotation marks. They're necessary for PhpStorm to distinguish between the file and the options. Note that login has two dashes, but i has only one. You can add -v if you like verbose output from Bash. The -login tells Bash to run it's configuration files (more on that in the next article), and the -i tells Bash that you want interactive mode.

As an alternative, you can click on the browse icon and navigate to the sh.exe file, wherever it is, but be sure to add the command-line options after the path.

I left all the checkboxes checked and it seems to work fine. When you're done, click on 'Apply' and then on 'OK'. You may have to restart PhpStorm for this all to take effect.

Phpstorm Git Bash Install

Use the 'Test' button to make sure you have the path correct.

Phpstorm Add Git Bash

Bash

If you haven't already, you also need to set the path to Git. Go to:

Set the path to:

or this if you're using the 64-bit version of Git:

As with setting up the shell, you can also use the browse button. Quotation marks are not necessary here, since there are no command-line options.

Launching the Terminal

At the bottom of the PhpStorm screen (bottom left on my version) you should see a 'Terminal' button. When you click on it, you should see a window with the Bash prompt, followed by a cursor. If the cursor is white, your typing will be ignored until you click in the window — then it will turn black. If you don't see that 'Terminal' button, you can use the View -> Toolbars menu option or Alt-F12 to bring you the terminal window.

I prefer to have the window floating. You can select that option from the little gear icon at the upper right of the window. Clicking on the minimize icon next to the gear icon, or on the 'Terminal' button will hide the window. If you click on the red X, it will close your terminal session and you'll lose your place. You can also have multiple Bash windows open by clicking on the + symbol, which is handy if you want to repeat actions in different directories, especially since you can use copy and paste.


Phpstorm Set Git Bash As Terminal

SUBSCRIBE to receive notifications of new blog posts.

Phpstorm Git Bash Tutorials

For information on how to use MODX to create a web site (and other topics), see my main web site, Bob's Guides, or better yet, buy my book: MODX: The Official Guide.

Looking for high-quality, MODX-friendly hosting? As of May 2016, Bob's Guides is hosted at A2 hosting. MODX will work fine at most hosting services, but having a MODX-friendly host can prevent a lot of frustration. Better yet, the A2 Solid-State-Drive servers are configured to handle the many Ajax and database calls made by MODX — especially the MODX Manager. My Manager runs about four times as fast as it did on my previous host. I particularly recommend the Swift package with the Performance Plus option.