fix: use git stash push instead of git stash save which is deprecated

This commit is contained in:
Bjarke Sporring
2026-01-18 09:27:12 +01:00
parent 382a125076
commit a898030a9f
2 changed files with 8 additions and 8 deletions

View File

@@ -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
```

View File

@@ -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 "<description>"
```
Stash changes with a descriptive message.