PhpStorm-EAP: Syncing files with remote server - phpstorm

When saving files (Ctrl-S), it's being uploaded automatically (as set in the config) and overwriting possible changes. Can I set PhpStorm to check and ask confirmation before overwriting ?
When I use the 'Synchronize myfile' option, it says 'Synchronized myfile completed successfullly', but I can't see any change on the server. I don't really understand what it's doing.

Can I set PhpStorm to check and ask confirmation before overwriting ?
You can, just enable "Warn when uploading over a newer file" and "Notify about remote changes" in "Settings | Build, Execution, Deployment | Deployment | Options".

Related

Clicked 'do not show again' on a prompt in PhpStorm, how to undo?

I had a notification in PhpStorm:
Debug session was finished without being paused. It may be caused by
path mappings misconfiguration or not synchronized local and remote
projects. To figure out the problem check path mappings configuration
for 'example.com' server at PHP | Servers or enable Break
at first line in PHP scripts option (from Run menu).
Do not show again
I clicked 'Do not show again' by mistake, and I'd like to undo that - I would like to see this warning when it happens. How can I undo "do not show again" here?
Settings/Preferences | PHP | Debug | Advanced settings | Notify if debug session was finished without being paused.

Disable local changes toolbar in PhpStorm

How to disable the local changes toolbar in PhpStorm?
It shows up when working with remote files.
Unfortunately, there is no known way to disable it.
Technically, this toolbar reminds you that you are editing remote file and it is not automatically saved apart from local files.
You may want to configure deployment with automatic upload. In this way, you will always edit your files locally and these will be auto-uploaded on save action (by timeout or changing editor focus).
More about deployment:
https://www.jetbrains.com/help/phpstorm/creating-a-remote-server-configuration.html

PhpStorm does not sync with the server

Here's the problem :
My project on phpStorm use a remote access to the server by FTP.
When I save a modified file, the file is uploaded normally to the serv, but when I create a folder on the serv, i don't see it in phpStorm.
Any idea?
PhpStorm is built around "local project files are the main ones -- deployed are secondary" idea. It's natural to have "automatically upload to remote host" (sync local with remote) functionality to follow such an idea.
At the same time the IDE does not have anything to "automatically sync remote with local" (the reverse: to automatically copy remote stuff back to local). Simply because it contradicts such an idea: local files are the main ones.
Therefore:
The "Synchronize" button that you are referring to does not do what you are expecting it to do. It syncs what the IDE knows about project files on a local file system. In other words: it checks if there were any changes to local files done outside of the IDE. It does not do anything with remote files.
NOTE: In modern 202x.x versions it has been renamed to "Reload All from Disk" to avoid such a confusion).
To manually sync with remote files (any direction) you have these main options:
Use Remote Host side panel (can be accessed via Tools | Deployment | Browse Remote Host if it’s closed/hidden) and download any files or folders manually (drag and drop can also be used, just make sure that you are copying files because by default IDE tries to "move" (copy+delete) instead of just "copy"). It has a "Refresh" button to refresh the remote location.
Use two-way synchronisation (with preview) accessible via right click on desired folder(s)/files and choosing Deployment | Synch with Deployed... where you can sync those files/folders both ways (by default newer stuff will override older regardless of the direction).
The IDE can automatically sync one way (from local to remote): just ensure that automatic deployment is enabled and you have one server (or a group) marked as Default for this project.
Settings (Preferences on macOS) | Build, Execution, Deployment | Deployment | Options | Upload changed files automatically to the default server is the option. Check other options there to better suit your needs.
Please refer to the official help pages for more info on deployment (including a simple video tutorial): https://www.jetbrains.com/help/phpstorm/deploying-applications.html
And the funny thing about it, it is not completly correct. The option underneath is missing.. 'skip external changes' should not be ticked.
In Mac -> PHPStorm -> preferences -> Build, Execution, Deployment -> options
Set the Upload as seen in the picture to always and make sure skip external changes is unticked.
It works for me in PhpStorm 2020.1

TortoiseHG Sync - How to save URL

I've recently migrated to Mercurial for source control and am using TortoiseHG. Everything is working great, but whenever I go to "Synchronize" to do a push, the remote repository URL is blank and I need to type it in every time. How do I save it so that the remote repository source is saved?
You did not mention which version of TortoiseHg, but there are two "standard" ways to save the URL:
1) Manually add the following lines to your <project_dir>\.hg\hgrc file:
[paths]
default = http://server/path/to/remote/repo
2) Click the "Save" icon in TortoiseHg's Sync view:

Workflow for using TextMate/Coda with Transmit and Versions

I use TextMate to do my HTMl,PHP,JS/Other languages and CSSEdit to do my CSS.
I want to integrate TextMate with Transmit better because at the moment I work like this:
TextMate: Edit code
Transmit: Look for folder and drag to online server
Firefox: Refresh page
Rinse, Repeat.
It feels very clunky to me and I do the same with CSSEdit (although CSSEdit's live preview means that I only have to upload once) but I would like to be able to, on save, have Transmit upload the edited document to the relevant place on the server (given that linked browsing is enabled).
Does anyone have a certain workflow that they follow or macros enabled in TextMate to do such tasks as they would certainly make my life a lot easier, Coda is also an option instead of TextMate if needed.
Being able to have Versions/Git-Tower auto commit on save would be great too.
I recommend #Adam's solution for the uploading part of your question but why are you using Git and Transmit simultaneously? Why not Git for everything?
My workflow:
On my machine I keep a Git repository where I do all the work. The working directory is served by MAMP so that I can test my code before commiting anything.
When I'm satisfied I commit my latest changes until I think the branch I'm working on is stable.
When I'm ready, I push to the server where a post-commit hook checks out the latest version to what the "pre-prod server".
When everything has been tested to death, branches merged and so on I check out manually the repository to the "prod server".
No need to use an FTP client at any point, everything is done from the editor (TextMate before, Vim now).
If you set up a site in Transmit, and open the local directory that holds your files, you can activate the Textmate Transmit bundle by typing ctrl-shift-f. Then hit either 1 or 2. 1 will upload the current directory, 2 will send the current file.
You might consider using Transmit's ability to mount FTP servers as volumes and simply edit the files directly on the server. To TextMate the mounted FTP server will appear to be just another volume. Search the help files for Transmit Disk, their name for this feature.