gitpractice.dev

brewly — Ch.7 · Set work aside

Exercise 1 of 6

Before you start

The stash

Git will not pull over a file you have changed but not committed. If the work is not ready to commit, stash it: git saves your changes away and gives you a clean folder.

git stash pop brings them back on top of wherever you are now, and removes the entry.

git stash
set your uncommitted changes aside
git pull
update your branch
git stash pop
bring your changes back
git status
check what you have
You can reopen this any time with “Lesson”.

Continue on a desktop

Typing git on a small screen is no fun. Open this page on a laptop or desktop to practise.

Back to the path