diff --git a/README.md b/README.md index 5a14cc8..edd9746 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ * [Import from a bundle](https://github.com/git-tips/tips#import-from-a-bundle) * [Get the name of current branch.](https://github.com/git-tips/tips#get-the-name-of-current-branch) * [Ignore one file on commit (e.g. Changelog).](https://github.com/git-tips/tips#ignore-one-file-on-commit-eg-changelog) +* [Stash changes before rebasing](https://github.com/git-tips/tips#stash-changes-before-rebasing) @@ -449,5 +450,10 @@ git rev-parse --abbrev-ref HEAD git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog ``` +## Stash changes before rebasing +```sh +git rebase --autostash +``` + diff --git a/tips.json b/tips.json index 3b52904..e3abadc 100644 --- a/tips.json +++ b/tips.json @@ -255,5 +255,9 @@ { "title": "Ignore one file on commit (e.g. Changelog).", "tip": "git update-index --assume-unchanged Changelog; git commit -a; git update-index --no-assume-unchanged Changelog" + }, + { + "title": "Stash changes before rebasing", + "tip": "git rebase --autostash" } ]