Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
courses
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nene Barry
courses
Commits
c3ce4d6a
Verified
Commit
c3ce4d6a
authored
5 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
example 2 of rebase
parent
dbdef34d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
2019/2019-09-24_advancedGitTraining/slides/rebase.md
+7
-7
7 additions, 7 deletions
2019/2019-09-24_advancedGitTraining/slides/rebase.md
with
7 additions
and
7 deletions
2019/2019-09-24_advancedGitTraining/slides/rebase.md
+
7
−
7
View file @
c3ce4d6a
...
@@ -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 wante
d
to keep both commit messages in one commit,
instead
change the
prompts
to squash
ing 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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment