mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add Include A Message With Your Stashed Changes as a git til
This commit is contained in:
@@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket.
|
|||||||
|
|
||||||
For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud).
|
For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud).
|
||||||
|
|
||||||
_937 TILs and counting..._
|
_938 TILs and counting..._
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -224,6 +224,7 @@ _937 TILs and counting..._
|
|||||||
- [Grep For A Pattern On Another Branch](git/grep-for-a-pattern-on-another-branch.md)
|
- [Grep For A Pattern On Another Branch](git/grep-for-a-pattern-on-another-branch.md)
|
||||||
- [Grep Over Commit Messages](git/grep-over-commit-messages.md)
|
- [Grep Over Commit Messages](git/grep-over-commit-messages.md)
|
||||||
- [Ignore Changes To A Tracked File](git/ignore-changes-to-a-tracked-file.md)
|
- [Ignore Changes To A Tracked File](git/ignore-changes-to-a-tracked-file.md)
|
||||||
|
- [Include A Message With Your Stashed Changes](git/include-a-message-with-your-stashed-changes.md)
|
||||||
- [Include Some Stats In Your Git Log](git/include-some-stats-in-your-git-log.md)
|
- [Include Some Stats In Your Git Log](git/include-some-stats-in-your-git-log.md)
|
||||||
- [Intent To Add](git/intent-to-add.md)
|
- [Intent To Add](git/intent-to-add.md)
|
||||||
- [Interactively Unstage Changes](git/interactively-unstage-changes.md)
|
- [Interactively Unstage Changes](git/interactively-unstage-changes.md)
|
||||||
|
|||||||
30
git/include-a-message-with-your-stashed-changes.md
Normal file
30
git/include-a-message-with-your-stashed-changes.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# Include A Message With Your Stashed Changes
|
||||||
|
|
||||||
|
If you were to quickly stash some changes, you end up with a stash reference
|
||||||
|
that git would attach a little context to, such as the latest commit SHA and
|
||||||
|
the first line of its commit message.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git stash list
|
||||||
|
stash@{0}: WIP on master: 6766419 Add link to source for latest TIL
|
||||||
|
```
|
||||||
|
|
||||||
|
Often this won't provide you the needed context to return to your stash and
|
||||||
|
pick up where you left off even days later.
|
||||||
|
|
||||||
|
You can customize the message of a stash with the `-m` flag.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git stash push -m 'made some changes'
|
||||||
|
```
|
||||||
|
|
||||||
|
When you view your stash list, you'll see your custom message.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ git stash list
|
||||||
|
stash@{0}: On master: made some changes
|
||||||
|
```
|
||||||
|
|
||||||
|
And hopefully that's the context you need to hit the ground running.
|
||||||
|
|
||||||
|
See `man git-stash` for more details.
|
||||||
Reference in New Issue
Block a user