You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/03-git-branching/sections/rebasing.asc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,20 +150,20 @@ Suppose you clone from a central server and then do some work off that.
150
150
Your commit history looks like this:
151
151
152
152
.Clone a repository, and base some work on it
153
-
image::images/perils-of-rebasing-1.png[Clone a repository, and base some work on it.]
153
+
image::images/perils-of-rebasing-1.png["Clone a repository, and base some work on it."]
154
154
155
155
Now, someone else does more work that includes a merge, and pushes that work to the central server.
156
156
You fetch them and merge the new remote branch into your work, making your history look something like this:
157
157
158
158
.Fetch more commits, and merge them into your work
159
-
image::images/perils-of-rebasing-2.png[Fetch more commits, and merge them into your work.]
159
+
image::images/perils-of-rebasing-2.png["Fetch more commits, and merge them into your work."]
160
160
161
161
Next, the person who pushed the merged work decides to go back and rebase their work instead; they do a `git push --force` to overwrite the history on the server.
162
162
You then fetch from that server, bringing down the new commits.
163
163
164
164
[[_pre_merge_rebase_work]]
165
165
.Someone pushes rebased commits, abandoning commits you've based your work on
166
-
image::images/perils-of-rebasing-3.png[Someone pushes rebased commits, abandoning commits you've based your work on.]
166
+
image::images/perils-of-rebasing-3.png["Someone pushes rebased commits, abandoning commits you've based your work on."]
167
167
168
168
Now you're both in a pickle.
169
169
If you do a `git pull`, you'll create a merge commit which includes both lines of history, and your repository will look like this:
0 commit comments