From 5d57c4f132cd703ada0ce5c575532db4a56bf3dc Mon Sep 17 00:00:00 2001 From: "Hemanth.HM" Date: Fri, 21 Aug 2015 19:34:59 +0530 Subject: [PATCH] rebases and merge feature branch to master. --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 764adb7..9876098 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ * [Update all the submodules](https://github.com/git-tips/tips#update-all-the-submodules) * [Show all commits in the current branch yet to be merged to master](https://github.com/git-tips/tips#show-all-commits-in-the-current-branch-yet-to-be-merged-to-master) * [Rename a branch](https://github.com/git-tips/tips#rename-a-branch) +* [rebases 'feature' to 'master' and merges it in to master ](https://github.com/git-tips/tips#rebases-feature-to-master-and-merges-it-in-to-master) @@ -353,5 +354,10 @@ __Alternatives:__ git branch -m [] ``` +## rebases 'feature' to 'master' and merges it in to master +```sh +git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1} +``` + diff --git a/tips.json b/tips.json index fc11b11..661847e 100644 --- a/tips.json +++ b/tips.json @@ -196,5 +196,9 @@ "title": "Rename a branch", "tip": "git branch -m ", "alternatives": ["git branch -m [] "] + }, + { + "title": "rebases 'feature' to 'master' and merges it in to master ", + "tip": "git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1}" } ]