git - Commit local files to different branches -
suppose i've made checkout branch master. there 2 files there: a , b.
i have edited both of them, have files a1 , b1. realized idea separate changes in following way:
- create
brancha, commita1there, leavebunchanged. (brancha has a1 , b) - create
branchb, commitb1there, leaveaunchanged. (branchb has b1 , a)
how achieve minimum effort?
you not have stash. creating new branch not wipe away uncommitted changes. should work:
git checkout -b brancha git add a1 git commit -m 'changes in brancha.' git checkout -b branchb head~ git add b b1 git commit -m 'changes in branchb.'
Comments
Post a Comment