Esconda todos os arquivos não testados.

Digamos que você modificou algum código no featurebranch e deseja enviar parte dele para o developbranch. Veja como:

add Gemfile # stage files you want to change
git stash
-k -u # stash all other files

git checkout develop

git commit
-m "Fresh gemfile."

git checkout feature

git stash pop
# unstash changes and keep going

Se você estiver recebendo o “erro: suas alterações locais nos arquivos a seguir serão substituídas pela mensagem checkout:”, tente o seguinte:

add Gemfile # stage files you want to change
git stash
-k -u # stash all other files
git stash
# stash changes you want to make

git checkout develop

git stash pop
# unstash changes you want to make
git commit
-m "Fresh gemfile."

git checkout feature

git stash pop
# unstash rest of changes and keep going

Além disso, encorajo você a usar uma descrição curta para esconderijos. Se você fizer isso, será mais fácil lembrar quais alterações eles contêm mais tarde:

git stash save --all -m 'Going for a coffee...'