Skip to content
Snippets Groups Projects
Verified Commit c3ce4d6a authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

example 2 of rebase

parent dbdef34d
No related branches found
No related tags found
No related merge requests found
...@@ -86,7 +86,7 @@ git rebase -i <branch> ...@@ -86,7 +86,7 @@ git rebase -i <branch>
# Example (1) # Example 1: Reword and fixup (1)
* Create and switch to your own branch * Create and switch to your own branch
* Add and commit two files to this branch: * Add and commit two files to this branch:
...@@ -107,7 +107,7 @@ Now, we want to: ...@@ -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: Perform an interactive rebase with the two last commits:
...@@ -141,12 +141,12 @@ $ git push origin myBranch -f ...@@ -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 ```bash
$ pick 1234567 add Micheal to attendee list $ pick 1234567 add william to attendee list
$ squash abcdef0 add Kevin 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. * 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 \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment