Phpstorm Stash

broken image


  1. PhpStorm 2020.1 is now available! This major release includes out-of-the-box composer.json support, code coverage with PCOV and PHPDBG, PHPUnit toolbox, new inspections, quick-fixes, and refactorings, advanced grammar checker, and many more benefits.
  2. GIT Auto Stash While using git, Is it possible when you change to a new or existing branch/changelist/task on PHPStorm to automatically stash the changes and deploy them? I though this feature did exist before.

Jan 03, 2020 Select the Git root where you want to apply a stash, and make sure that the correct branch is checked out. Select the stash you want to apply from the list. To remove the selected stash after it is applied, select the Pop stash option. Click to see full answer. Contribute to Zutatensuppe/git-howto development by creating an account on GitHub.

News

The popular static analyzers PHPStan and Psalm will soon be supported in PhpStorm. Even better, the code behind this support will be open source.

It's always been possible to run PHPStan and Psalm as external tools. Now that we see significant interest in the tools among the community, we'd like to improve your experience of using them in PhpStorm.


Source: JetBrains Developer Ecosystem Survey Report.

What's implemented

First, we've focused on making PHPStan and Psalm work as first-class quality tools in PhpStorm.

  • Both work just like all other quality tools, with on-the-fly file highlighting and the ability to batch-run inspections.
  • They can be run via remote interpreters such as Docker, WSL, and others.
  • PHPStan and Psalm settings in composer.json are detected automatically.
  • The settings for PHPStan and Psalm can be configured in the corresponding inspection options.

What's coming

We plan to add support for Psalm annotations in PhpStorm code analysis. This feature is still in the early stages of development, and we will roll out support gradually starting with the most popular tags.

Another big part is support for array key and value types. This one is also under heavy development.

This is all open-source

We've decided to decouple the support of PHPStan and Psalm into separate plugins. Both are open-source and are already available on GitHub under the Apache 2 license:

https://github.com/JetBrains/phpstorm-psalm-plugin
https://github.com/JetBrains/phpstorm-phpstan-plugin

The community is welcome to participate and help improve the IDE's support for these static analysis tools.

On the other hand, these plugins can be seen as a reference example and a source of inspiration for your own plugins. For example, you can create support for your favorite tool in PhpStorm, such as the Pest IntelliJ plugin for Pest. Or you could even make a commercial solution such as Laravel Idea.

If you're considering developing a paid plugin, keep in mind that JetBrains provides the Marketplace platform which helps plugin vendors deliver their plugins to a wider audience, and takes care of things like payments for a modest fee.

When will this be available to try?

The plugins are most likely to be bundled with PhpStorm 2020.3 and enabled by default. This means it will be possible to try the support around September when the Early Access Program for 2020.3 starts.

⚠️ Please note that while the plugins' source code is already available, it will not work with PhpStorm 2020.1 or 2020.2.

That's all for today. We are eager to hear what you think about this!

Your JetBrains PhpStorm team
The Drive to Develop

Shelving is temporarily storing pending changes you have not committed yet. This is useful, for example, if you need to switch to another task, and you want to set your changes aside to work on them later.

With PhpStorm, you can shelve both separate files and entire .

You cannot shelve unversioned files, which are files that have not been added to version control.

Once shelved, a change can be applied as many times as you need.

Shelve changes

  1. In the Commit tool window Alt+0, right-click the files or the changelist you want to put to a shelf and select Shelve changes from the context menu.

  2. In the Shelve Changes dialog, review the list of modified files.

  3. In the Commit Message field, enter the name of the shelf to be created and click the Shelve Changes button.

Phpstorm Stash Free

Phpstorm

You can also shelve changes silently, without displaying the Shelve Changes dialog. To do this, select a file or a changelist you want to shelve, and click the Shelve Silently icon on the toolbar, or press Ctrl+Shift+H. The name of the changelist containing the changes you want to shelve will be used as the shelf name.

To avoid ending up with numerous shelves with the same name (such as Default, for example), you can drag a file or a changelist from the Local Changes view to the Shelf tab, wait a second until it's activated, and edit the new shelf name on-the-fly when you release the mouse button.

If you need to copy your changes to a shelf without resetting local changes, press Ctrl+Shift+A and look for the Save to Shelf action.

Unshelve changes

Unshelving is moving postponed changes from a shelf to a pending changelist. Unshelved changes can be filtered out from view or removed from the shelf.

  1. In the Shelf tab, select the changelist or the files you want to unshelve.

  2. Press Ctrl+Shift+U or choose Unshelve from the context menu of the selection.

  3. In the Unshelve Changes dialog, specify the changelist you want to restore the unshelved changes to in the Name field. You can select an existing changelist from the list or enter the name for a new changelist to be created containing the unshelved changes. You can enter the description of the new changelist in the Comment field (optional).

    If you want to make the new changelist active, select Set active. Otherwise, the current active changelist remains active.

  4. If you want PhpStorm to preserve the of a task associated with the new changelist on its deactivation and restore the context when the changelist becomes active, select the Track context option (see tasks and contexts for details).

  5. If you want to remove the changes you are about to unshelve, select the Remove successfully applied files from the shelf option. The unshelved files will be removed from this shelf and added to another changelist and marked as applied. They will not be removed completely until deleted explicitly by clicking on the toolbar, or selecting Clean Already Unshelved from the context menu.

    If you've deleted unshelved files by accident, you can view and restore them from the Recently Deleted node.

  6. Click OK. If conflicts occur between the patched version and the current version, resolve them as described in Resolve conflicts.

You can also unshelve changes silently, without displaying the Unshelve Changes dialog. To do this, select a file or a changelist you want to unshelve, and click the Unshelve Silently icon on the toolbar, or press Ctrl+Alt+U. The unshelved files will be moved to the active pending changelist.

You can also drag a file or a changelist from the Shelf tab to the Local Changes view to unshelve it silently. If you drag it holding the Ctrl key, it will be copied to the Local Changes tab instead of being removed from the shelf.

Discard shelved changes

  1. In the Shelf view, select the changelist that contains the changes you do not want to keep any more.

  2. Right-click it and choose Delete from the context menu, or press Delete.

Restore unshelved changes

PhpStorm lets you reapply unshelved changes if necessary. All unshelved changes can be reused until they are removed explicitly by clicking the icon on the toolbar, or selecting Clean Already Unshelved from the context menu.

  1. Make sure that the Show Already Unshelved toolbar option is enabled.

  2. Select the files or the shelf you want to restore.

  3. From the context menu of the selection, choose Restore.

Apply external patches

You can import patches created inside or outside PhpStorm and apply them as shelved changes.

  1. In the Shelf view, choose Import Patches from the context menu.

  2. In the dialog that opens, select the patch file to apply. The selected patch appears in the Shelf tab as a shelf.

  3. Select the newly added shelf with the patch and choose Unshelve Changes from the context menu of the selection.

Automatically shelve base revision

Phpstorm Git Stash

It may be useful to configure PhpStorm to always shelve base revisions of files that are under Git version control.

Phpstorm Static Analysis

  1. In the Settings/Preferences dialog Ctrl+Alt+S, select the Version Control | Shelf.

  2. Select the Shelve base revisions of files under distributed version control systems option.

    If this option is enabled, the base revision of files will be saved to a shelf that will be used during a 3-way merge if applying a shelf leads to conflicts. If it is disabled, PhpStorm will look for the base revision in the project history, which may take a while; moreover, the revision that the conflicting shelf was based on may be missing (for example, if the history was changed as a result of the rebase operation).

Change the default shelf location

By default, the shelf directory is located under your project directory. However, you may want to change the default shelf location. This can be useful, for example, if you want to avoid deleting shelves accidentally when cleaning up your working copy, or if you want to store them in a separate repository allowing shelves to be shared among your team members.

Phpstorm Stash Account

  1. In the Settings/Preferences dialog Ctrl+Alt+S, select the Version Control | Shelf node on the left.

  2. Click the Change Shelves Location button and specify the new location in the dialog that opens.

  3. If necessary, select the Move shelves to the new location option to move existing shelves to the new directory.

Phpstorm Stash List

Watch this video tutorial on how to benefit from shelves to be able to switch to a different task without losing unfinished work:

Phpstorm Stash Free

Last modified: 08 March 2021




broken image