Git - switching between branches in the middle of work

Posted by Art on Stack Overflow See other posts from Stack Overflow or by Art
Published on 2010-03-13T02:03:55Z Indexed on 2010/03/13 2:07 UTC
Read the original article Hit count: 316

For various reasons (code review mostly) I need to switch from current development branch to other branches quite often.

Currently, I use either 'git stash' to shelve the uncommitted changes, checkout other branch, then switch back and do 'git stash apply'

However, sometimes I'd have some newly added files there, which are not tracked. Unfortunately, stashing does not affect them. In this case I'd have to add them to the index and stash.

What I am looking here for is a workflow where I'd have to perform a minimal set of actions to switch the branches, preferably avoiding adding of files into the index.

© Stack Overflow or respective owner

Related posts about git

Related posts about version-control