gitpractice.dev

brewly — Ch.7 · When the stash conflicts

Exercise 3 of 6

Before you start

Conflicts from a pop

If the same lines changed since you stashed, pop leaves conflict markers. "Updated upstream" is the current code, "Stashed changes" is yours.

Solve the file and git add it. There is no merge to finish: just commit when you are ready.

After a conflict git keeps the entry, so drop it yourself once you are satisfied.

git stash pop
bring the changes back
git add <file>
mark it solved
git commit -m "What you did"
commit the result
git stash drop
delete the entry you no longer need
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