Tuesday, 27 August 2013

git change branches with some files being modified

git change branches with some files being modified

I'm working on the branch 'br3'. I have 3 modified files. I want to commit
them to different branch, for example 'br1'. I know that I can safely
change branches only if I don't have modified files in the tree, so I need
to either:
copy files, revert changes, change branch, paste files
stash files, change branch, unstash them
I've never tried second option and I'm not sure it will work out. Will it?
Or there is better alternative to the ones I outlined above?

No comments:

Post a Comment