diff --git a/README.md b/README.md index c564274..74ab58e 100644 --- a/README.md +++ b/README.md @@ -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). -_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 Over Commit Messages](git/grep-over-commit-messages.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) - [Intent To Add](git/intent-to-add.md) - [Interactively Unstage Changes](git/interactively-unstage-changes.md) diff --git a/git/include-a-message-with-your-stashed-changes.md b/git/include-a-message-with-your-stashed-changes.md new file mode 100644 index 0000000..3cf1182 --- /dev/null +++ b/git/include-a-message-with-your-stashed-changes.md @@ -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.