Dealing With a Scenario
Explore how to manage uncertain changes in your code using Git stash. This lesson guides you through saving uncommitted work, storing it safely, and later reapplying it to avoid conflicts when updating your repository. Understand the stash stack concept and how to inspect and pop your stashed changes, helping you maintain a smooth Git workflow during development.
We'll cover the following...
We'll cover the following...
Scenario
Here is a basic example of a change I want to “stash”:
1 mkdir lgthw_git_stash_1
2 cd lgthw_git_stash_1
3 git init
4 echo 'Some content' > file1
5 git add file1
6 git commit -am initial
7 echo 'Some changes I am not sure about' >> file1
Now imagine I’m in the middle of some work, and Alice lets me know that there’s an important update to the code that I need to pull from
First, you can see what changes you have made ...