fix: use git stash push instead of git stash save which is deprecated
This commit is contained in:
@@ -101,7 +101,7 @@ Suddenly, your teammate reports a **critical security bug** in production! You n
|
|||||||
|
|
||||||
3. **Stash your work with a message:**
|
3. **Stash your work with a message:**
|
||||||
```pwsh
|
```pwsh
|
||||||
git stash save "WIP: login feature"
|
git stash push -m "WIP: login feature"
|
||||||
```
|
```
|
||||||
|
|
||||||
4. **Verify working directory is clean:**
|
4. **Verify working directory is clean:**
|
||||||
@@ -166,7 +166,7 @@ Suddenly, your teammate reports a **critical security bug** in production! You n
|
|||||||
|
|
||||||
```pwsh
|
```pwsh
|
||||||
# Stash current changes with a message
|
# Stash current changes with a message
|
||||||
git stash save "description"
|
git stash push -m "description"
|
||||||
|
|
||||||
# Stash without a message (not recommended)
|
# Stash without a message (not recommended)
|
||||||
git stash
|
git stash
|
||||||
@@ -273,7 +273,7 @@ The verification will check that:
|
|||||||
**Solution:**
|
**Solution:**
|
||||||
```pwsh
|
```pwsh
|
||||||
# Stash your changes first
|
# Stash your changes first
|
||||||
git stash save "work in progress"
|
git stash push -m "work in progress"
|
||||||
|
|
||||||
# Now you can switch
|
# Now you can switch
|
||||||
git switch other-branch
|
git switch other-branch
|
||||||
@@ -321,7 +321,7 @@ git stash show -p stash@{0}
|
|||||||
|
|
||||||
## Tips for Success
|
## 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
|
💡 **Use pop, not apply** - Pop removes the stash automatically, keeping your stash list clean
|
||||||
💡 **Stash before pulling** - Avoid merge conflicts when pulling updates
|
💡 **Stash before pulling** - Avoid merge conflicts when pulling updates
|
||||||
💡 **Preview before applying** - Use `git stash show -p` to see what's in a stash
|
💡 **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
|
### Quick Branch Switch
|
||||||
```pwsh
|
```pwsh
|
||||||
# You're working on feature-A
|
# You're working on feature-A
|
||||||
git stash save "feature A progress"
|
git stash push -m "feature A progress"
|
||||||
git switch hotfix-branch
|
git switch hotfix-branch
|
||||||
# Fix the issue, commit
|
# Fix the issue, commit
|
||||||
git switch feature-A
|
git switch feature-A
|
||||||
@@ -343,7 +343,7 @@ git stash pop
|
|||||||
### Pull with Local Changes
|
### Pull with Local Changes
|
||||||
```pwsh
|
```pwsh
|
||||||
# You have uncommitted changes
|
# You have uncommitted changes
|
||||||
git stash save "local changes"
|
git stash push -m "local changes"
|
||||||
git pull
|
git pull
|
||||||
git stash pop
|
git stash pop
|
||||||
# Resolve conflicts if any
|
# Resolve conflicts if any
|
||||||
@@ -352,7 +352,7 @@ git stash pop
|
|||||||
### Test Clean State
|
### Test Clean State
|
||||||
```pwsh
|
```pwsh
|
||||||
# Stash changes to test on clean code
|
# Stash changes to test on clean code
|
||||||
git stash save "testing clean state"
|
git stash push -m "testing clean state"
|
||||||
# Run tests
|
# Run tests
|
||||||
git stash pop # Restore your changes
|
git stash pop # Restore your changes
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -287,7 +287,7 @@ git stash
|
|||||||
Save your uncommitted changes temporarily and revert to a clean working directory.
|
Save your uncommitted changes temporarily and revert to a clean working directory.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git stash save "description"
|
git stash push -m "<description>"
|
||||||
```
|
```
|
||||||
Stash changes with a descriptive message.
|
Stash changes with a descriptive message.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user