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 , commit a1 there, leave b unchanged. (brancha has a1 , b)
  • create branchb , commit b1 there, leave a unchanged. (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

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -