I would like to use this workflow:

  1. Stage some changes.
  2. Save the unstaged changes to the stash.
  3. Do some stuff with the things in stage (build, test, etc.).
  4. Commit.
  5. Restore the unstaged changes.

Is there a way to do step 2?

Example:

git init
echo one >file
git add file
git commit
echo two >>file
git add file
echo three >>file
git stash push
test
git commit
git stash pop

14 Answers
14

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *