From c3ce4d6a1275b070e969ee951db7e61a5ced767c Mon Sep 17 00:00:00 2001 From: laurentheirendt <laurent.heirendt@uni.lu> Date: Mon, 23 Sep 2019 10:30:10 +0200 Subject: [PATCH] example 2 of rebase --- .../slides/rebase.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/2019/2019-09-24_advancedGitTraining/slides/rebase.md b/2019/2019-09-24_advancedGitTraining/slides/rebase.md index 7e8e9c1e..e7d96f5a 100644 --- a/2019/2019-09-24_advancedGitTraining/slides/rebase.md +++ b/2019/2019-09-24_advancedGitTraining/slides/rebase.md @@ -86,7 +86,7 @@ git rebase -i <branch> -# Example (1) +# Example 1: Reword and fixup (1) * Create and switch to your own branch * Add and commit two files to this branch: @@ -107,7 +107,7 @@ Now, we want to: -# Example (2) +# Example 1: Reword and fixup (2) Perform an interactive rebase with the two last commits: @@ -141,12 +141,12 @@ $ git push origin myBranch -f -# Practical: Git Interactive Rebasing +# Example 2: Pick and squash (2) -* If you wanted to keep both commit messages in one commit, instead change the prompts to squashing instead +* If you wante to keep both commit messages in one commit, change the action to `squash` ```bash -$ pick 1234567 add Micheal to attendee list -$ squash abcdef0 add Kevin to attendee list +$ pick 1234567 add william to attendee list +$ squash abcdef0 add roberta to attendee list ``` -* This will create a commit with both files still in, but the commit message of that commit will be the two commit messages of the two files combined. \ No newline at end of file +* This will create a commit with both modified files, with the commit message being a combination of the two commit messages. \ No newline at end of file -- GitLab