git gui: Merge without checkout

(See my previous post if you need to know how to add git gui commands.)

When I am fixing something in release branch I need to merge changes into main. But I have separated folders for various releases/mains. The reason is, that:

  • Gradle uses different dependencies for different releases

  • NPM uses different dependencies for different releases

  • I always suffer by various build issues when switching between versions

Therefore switching branches is not an easy task. So I have multiple folders, one per release each. But then – how to merge results from one branch to another? If I check out another branch in folder dedicated to some version it immediatelly start to cause issues: Eclipse tries to execute Gradle, Webpack hot reload starts to compile code, … So I have to close Eclipse, Webpack, …

Fortunatelly git allows to merge branches without checkout. So I prepared git gui command for merging from current branch into master:

[guitool "Merge current branch into master"]
cmd = git fetch . \$(git branch | grep \\\* | cut -d ' ' -f2):master

Enjoy!

Tags:  GIT