From 978e48496734b3bba847e9081e96bca399d84775 Mon Sep 17 00:00:00 2001 From: Cameron Drake Date: Tue, 29 Jul 2014 11:53:00 -0700 Subject: [PATCH 1/3] Update README.md --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1ec8479..c33ebd6 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,15 @@ If everything is successful, you should see something like this: ``` (master)$ Successfully rebased and updated refs/heads/master. ``` +### Possible issues with merging +Safe merging strategy: +```sh +(master)$ git merge --no-ff --no-commit featurebranch +``` +#### I need to merge a branch into a single commit +```sh +(master)$ git merge --squash featurebranch +``` ### Possible issues with interactive rebases @@ -153,6 +162,11 @@ some code You will need to resolve the differences between the code that was added in your new commit (in the example, everything from the middle line to `new-commit`) and your `HEAD`. +Sometimes these merges are complicated and you should use a visual diff editor: +```sh +(master*)$ git mergetool -t opendiff +``` + After you have resolved all conflicts and tested your code, `git add` the files you have changed, and then continue the rebase with `git rebase --continue` ``` @@ -267,4 +281,3 @@ And finally, let's cherry-pick the commit for bug #14: ``` (14)$ git cherry-pick 5ea5173 ``` - From 88252b2d91d0e8bf79d6d1aff373d69bbc23dda7 Mon Sep 17 00:00:00 2001 From: Cameron Drake Date: Mon, 16 Mar 2015 12:15:05 -0700 Subject: [PATCH 2/3] PR feedback --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c33ebd6..c19ccf6 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,9 @@ If everything is successful, you should see something like this: (master)$ Successfully rebased and updated refs/heads/master. ``` ### Possible issues with merging -Safe merging strategy: +#### Safe merging strategy: +```--no-commit``` performs the merge but pretends the merge failed and does not autocommit, giving the user a chance to inspect and further tweak the merge result before committing. ```no-ff``` maintains evidence that a feature branch once existed, keeping project history consistent. + ```sh (master)$ git merge --no-ff --no-commit featurebranch ``` @@ -203,7 +205,7 @@ Since rebasing **replaces the old commit(s) with a new one**, you must force pus Check out a new branch, then return to your master branch ``` -(master)$ git checkout -b new-branch +(master)$ git checkout -b new-branch (new-branch)$ git checkout master (master)$ ``` @@ -229,7 +231,7 @@ Author: Alex Lee Date: Tue Jul 22 15:39:27 2014 -0400 Bug #21 - Added CSRF protection - + commit 5ea51731d150f7ddc4a365437931cd8be3bf3131 Author: Alex Lee Date: Tue Jul 22 15:39:12 2014 -0400 From c108121f94a0e625637bfa6b4b9955a2d1d0c79e Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Mon, 16 Mar 2015 13:09:41 -0700 Subject: [PATCH 3/3] Doctoc --- README.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 62c74f0..b460272 100644 --- a/README.md +++ b/README.md @@ -22,19 +22,9 @@ For clarity's sake all examples in this document use customized bash prompt in o - [I need to add staged changes to the previous commit](#i-need-to-add-staged-changes-to-the-previous-commit) - [I tried to push my amended commit to a remote, but I got an error message](#i-tried-to-push-my-amended-commit-to-a-remote-but-i-got-an-error-message) - [I need to combine commits](#i-need-to-combine-commits) - - [I want to combine only unpushed commits](#i-want-to-combine-only-unpushed-commits) - - [Possible issues with interactive rebases](#possible-issues-with-interactive-rebases) - - [The rebase editing screen says 'noop'](#the-rebase-editing-screen-says-noop) - - [There were conflicts](#there-were-conflicts) + - [Possible issues with merging](#possible-issues-with-merging) + - [Safe merging strategy:](#safe-merging-strategy) - [some code](#some-code) - - [When I try to push, I get an error message:](#when-i-try-to-push-i-get-an-error-message) - - [I committed with the wrong name and email configured](#i-committed-with-the-wrong-name-and-email-configured) - - [I committed to master instead of a new branch](#i-committed-to-master-instead-of-a-new-branch) - - [I made several commits on a single branch that should be on different branches](#i-made-several-commits-on-a-single-branch-that-should-be-on-different-branches) - - [I want to delete local branches that were deleted upstream](#i-want-to-delete-local-branches-that-were-deleted-upstream) - - [I accidentally deleted my branch](#i-accidentally-deleted-my-branch) - - [I want to add aliases for some git commands](#i-want-to-add-aliases-for-some-git-commands) - - [I pulled from/into the wrong branch](#i-pulled-frominto-the-wrong-branch)