I have a buggy master branch that I need to debug. To do this, I want to insert a bunch of debugging procedures (for example, print variables), indicate an error and apply corrections. Later I want to merge corrections into the master branch, but I do not want to skip debugging changes.
# create debug branch git checkout -b debug
Now do the correct fix and commit
git commit
Go to the master branch ...
git checkout master
... and combine with the fix without debugging changes
git merge fix
How to merge fix without debug ?
source share