- make changes
git stash save
git checkout -b xxx
git stash pop
where xxx
is the new branch name
git stash save
git checkout -b xxx
git stash pop
where xxx
is the new branch name
AFAIK, you don't need to stash changes. Commits only apply to the current branch. But there are exceptions, e.g. untracked files. Anyway git will let you know if any file would be lost when checking out
@xxxVxxx no, stashes are separate from branches, "floating" if you will. You can apply them anywhere, any branch, but always in the current branch (checkout to apply to other branches). You mean the files come back with old changes or the stashed changes?
Thanks @bernardoadc
wow
But the moment i change the branch to master those files come back. Is it possible to only stash those changes to only that branch