From c46f0499748fd66a31237774097731752f28ae44 Mon Sep 17 00:00:00 2001 From: Eric James Michael Ritz Date: Wed, 28 Oct 2015 00:32:07 -0400 Subject: [PATCH] Add a tip for automatically stashing changes before a rebase Signed-off-by: Eric James Michael Ritz --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) 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" } ]