diff --git a/01-essentials/07-stash/README.md b/01-essentials/07-stash/README.md index c0505b4..1cb4192 100644 --- a/01-essentials/07-stash/README.md +++ b/01-essentials/07-stash/README.md @@ -101,7 +101,7 @@ Suddenly, your teammate reports a **critical security bug** in production! You n 3. **Stash your work with a message:** ```pwsh - git stash save "WIP: login feature" + git stash push -m "WIP: login feature" ``` 4. **Verify working directory is clean:** @@ -166,7 +166,7 @@ Suddenly, your teammate reports a **critical security bug** in production! You n ```pwsh # Stash current changes with a message -git stash save "description" +git stash push -m "description" # Stash without a message (not recommended) git stash @@ -273,7 +273,7 @@ The verification will check that: **Solution:** ```pwsh # Stash your changes first -git stash save "work in progress" +git stash push -m "work in progress" # Now you can switch git switch other-branch @@ -321,7 +321,7 @@ git stash show -p stash@{0} ## Tips for Success -💡 **Always add a message** - `git stash save "your message"` helps you remember what you stashed +💡 **Always add a message** - `git stash push -m "your message"` helps you remember what you stashed 💡 **Use pop, not apply** - Pop removes the stash automatically, keeping your stash list clean 💡 **Stash before pulling** - Avoid merge conflicts when pulling updates 💡 **Preview before applying** - Use `git stash show -p` to see what's in a stash @@ -333,7 +333,7 @@ git stash show -p stash@{0} ### Quick Branch Switch ```pwsh # You're working on feature-A -git stash save "feature A progress" +git stash push -m "feature A progress" git switch hotfix-branch # Fix the issue, commit git switch feature-A @@ -343,7 +343,7 @@ git stash pop ### Pull with Local Changes ```pwsh # You have uncommitted changes -git stash save "local changes" +git stash push -m "local changes" git pull git stash pop # Resolve conflicts if any @@ -352,7 +352,7 @@ git stash pop ### Test Clean State ```pwsh # Stash changes to test on clean code -git stash save "testing clean state" +git stash push -m "testing clean state" # Run tests git stash pop # Restore your changes ``` diff --git a/GIT-CHEATSHEET.md b/GIT-CHEATSHEET.md index d8995a6..dd85657 100644 --- a/GIT-CHEATSHEET.md +++ b/GIT-CHEATSHEET.md @@ -287,7 +287,7 @@ git stash Save your uncommitted changes temporarily and revert to a clean working directory. ```bash -git stash save "description" +git stash push -m "" ``` Stash changes with a descriptive message.