As the title suggests...
I have a development server that I develop on. On occasion, I'll find a bug that needs to be fixed, sometimes, I need to fix it right away and deploy to production.
When this happens, I find I have to back out any changes that aren't ready for production, push the fix, then put my changes back in and continue my work.
My build process is a gulp script that pushes everything to a build folder, minifying css, js, etc... but it pushes the entire system. I have no way to selectively say push these 3 files, but not the rest.
After gulp runs and I take a quick look at a staging environment I have setup, an SSH script pushes to the production server.
Is there any "easy" way to push specific files, when they need to be pushed?
Yes, maybe.
In Node.js projects, I use git flow hotfix based on the current master branch (because our CI deploys only from master after all tests pass). I fix my stuff, close the hotfix via git flow and our CI does the rest. It issues a remote command to do git pull into a new folder and then run npm install. Another script periodically checks for new folders, starts the node project inside of the new folder, waits for errors for about few seconds, updates our Nginx config, forces Nginx to reload its config and kills the old Node.js app. Almost zero downtime (waiting only for Nginx to reload, which finishes in few milliseconds).
For your PHP projects, I can imagine you compare your dist folders of the currently deployed version with the current ready-to-deploy version to pick and copy only the changed files. Shouldn't be a big issue. If needed, you can create checksums of your files before pushing them to a remote server. This way you can compare the hashes locally without having two copies of your project on HDD - if space or network bandwidth matters.
Well you should work with git branches.
Lets say master branch is for production usw. And your develop branch has the latest changes.
If you now need to fix a bug, but don't want to push all changes you've made in develop, simply checkout master and create a bugfix branch. Fix the stuff, test it and merge the bugfix into the master branch and push master to production.
This way you only changed what you need to. Don't forget you merge the bugfix branch then into your develop branch, so the bug is fixed there too.
In terms of deployment, I don't think there is an easy way just so upload specific files. Then you should just do it "by hand". But working with git branches, is definitly the cleaner way :)=
A Google Chrome Dev Tools extension for debugging Angular 2 applications. https://augury.angular.io/
Thanos Korakas
Coding around
Working with git branches. Every new feature is a new branch. Merging every new feature to dev branch, CI run your tests. Then you can select to merge manually or automate CI to merge dev to master branch and deploy your application.