git commit branch to another code example
Example 1: git commit current changes to existing branch
git stash
git checkout other-branch
git stash pop
Example 2: git merge branch to another branch
git checkout targetBranch
git merge sourceBranch
git stash
git checkout other-branch
git stash pop
git checkout targetBranch
git merge sourceBranch