Skip to content

Commit c46f049

Browse files
author
Eric James Michael Ritz
committed
Add a tip for automatically stashing changes before a rebase
Signed-off-by: Eric James Michael Ritz <[email protected]>
1 parent 1646af5 commit c46f049

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
* [Import from a bundle](https://github.com/git-tips/tips#import-from-a-bundle)
6565
* [Get the name of current branch.](https://github.com/git-tips/tips#get-the-name-of-current-branch)
6666
* [Ignore one file on commit (e.g. Changelog).](https://github.com/git-tips/tips#ignore-one-file-on-commit-eg-changelog)
67+
* [Stash changes before rebasing](https://github.com/git-tips/tips#stash-changes-before-rebasing)
6768

6869
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
6970
<!-- @doxie.inject end toc -->
@@ -449,5 +450,10 @@ git rev-parse --abbrev-ref HEAD
449450
git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog
450451
```
451452

453+
## Stash changes before rebasing
454+
```sh
455+
git rebase --autostash
456+
```
457+
452458
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
453459
<!-- @doxie.inject end -->

tips.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,5 +255,9 @@
255255
{
256256
"title": "Ignore one file on commit (e.g. Changelog).",
257257
"tip": "git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog"
258+
},
259+
{
260+
"title": "Stash changes before rebasing",
261+
"tip": "git rebase --autostash"
258262
}
259263
]

0 commit comments

Comments
 (0)