2

I would like to do a git difftool to make changes on both, the left and the right side.

Suppose that I am working on a branch named feature on which I found and corrected some cosmetic issues such as indentation or spelling errors. However I don't want these changes to be part of my final merge with master because they are not part of the implemented feature.

So what I usually do is checkout -b small_fixes master and git difftool feature. I then import all the minor changes on that branch and eventually I git rebase master && git branch -d small_fixes.

Now I have much less differences between master and features and all these differences are strictly related to the feature. It allows me to do a proper code review before the final git merge --squash feature.

The main problem here is that git difftool master have temporary files on the left side (master). I can make changes on the working copy but not the master. So if I want to change both sides, I need two distinct operations.

I am wondering if there is a tool that can allow to save the changes on the temporary files then commit or stash them on the master branch.

Note that this situation also appear during a git difftool --dir-diff on which both sides are temporary files.

So, the question is: how can I use difftool to make changes on both sides, then commit these changes simultaneously?

nowox
  • 25,978
  • 39
  • 143
  • 293

0 Answers0