How to get changes between two git commits and upload them?

Answered

In PhpStorm, when I have uncommitted git changes in my project I can see them in the commit tab like this:

I can right click on the ‘Changes’ title, select ‘Deployment’ and upload all the changes to the remote server. Now I need to do the same but for changes between two selected commits - I want all files changed between those commits to be uploaded to the server. Is this possible?

When I view the git log I can select two commits, right click and select `Compare Versions` - I can see the changed files in the pane to the right but I can't find any option to deploy the changes nor save them to disk.

Currently, when I need to upload changes between commits I use TortoiseGit, which allows me to export changed files to a directory and then I upload those files via an ftp client. But I'd like to do the same without having to use 3rd party tools.

 

0
7 comments

Hi,

You can select these commits, right click and create a patch. 

Then you can run this patch, and these changes will be visible in the changes, and you may upload from there. (or upload the patch directly) 

0

What do you mean by “run this patch”? Where and how do I run it? When I open the patch file in PhpStorm it is shown as a diff or text in the editor but I can't see any option to run it.

0

Please see: https://www.jetbrains.com/help/idea/using-patches.html, you can apply the patch or apply it via clipboard. 

0

That link doesn't work for me, did you mean https://www.jetbrains.com/help/idea/using-patches.html ? I've read that already but applying patch is not what I want - in this case applying the patch will integrate changes from the patch into my project, which doesn't make sense because my project already has all the files in the state present in the patch so applying the patch will simply overwrite the files with the same content and the IDE will detect no changes.

I would need a way to upload the files from the patch to the server. Is this possible? Or better yet, to skip the patch entirely since this step seems like a workaround - I don't need patch files, I just want to upload changes between two commits.

0

BTW, this forums does weird things with links, your link seems to be correct but the forum adds some long weird code to it, which makes it unavailable to me. The link I posted also got some code appended to it but it works for me, however I don't know if it will work for other people.

0

Unfortunately, this is not possible. 

Using the patch will make the changes appear in the changelist (unless these changes are latest)

0

Okay, I think I'll file a feature request for this. It is definitely something that should be possible in the IDE.

0

Please sign in to leave a comment.