@@ -38,7 +38,7 @@ to be the SHA-1 of your last commit).
38
38
39
39
### Simple Case
40
40
41
- ![ ] ( ../artwork/diagrams/branches1.eps )
41
+ ![ ] ( ../artwork/diagrams/branches1.svg )
42
42
43
43
Now,
44
44
let's see how Git handles branching,
@@ -54,7 +54,7 @@ We create a new branch called `experiment` off of our main branch,
54
54
which is by convention called ` master ` .
55
55
We then switch to the new branch and create a few commits.
56
56
57
- ![ ] ( ../artwork/diagrams/branch-story1.eps )
57
+ ![ ] ( ../artwork/diagrams/branch-story1.svg )
58
58
59
59
Then,
60
60
our boss comes in and says we need a hot fix to production.
@@ -64,7 +64,7 @@ push the release and then tag the new commit with the release number.
64
64
Then we go back to our ` experiment ` branch,
65
65
continue working and commit again.
66
66
67
- ![ ] ( ../artwork/diagrams/branch-story2.eps )
67
+ ![ ] ( ../artwork/diagrams/branch-story2.svg )
68
68
69
69
At this point,
70
70
we show the new branch code to our co-workers
@@ -74,7 +74,7 @@ so we merge the changes and delete our `experiment` branch.
74
74
75
75
Our history of commit objects now looks like this:
76
76
77
- ![ ] ( ../artwork/diagrams/branch-story3.eps )
77
+ ![ ] ( ../artwork/diagrams/branch-story3.svg )
78
78
79
79
### Remotes
80
80
@@ -96,7 +96,7 @@ one to `origin/master` which points to where the master branch was
96
96
on the person's repository you cloned from when you did so,
97
97
and a ` master ` branch that points to the most recent local commit.
98
98
99
- ![ ] ( ../artwork/diagrams/remote-story1.eps )
99
+ ![ ] ( ../artwork/diagrams/remote-story1.svg )
100
100
101
101
Now let's say you run a ` fetch ` .
102
102
A fetch pulls all the refs and objects that you don't already have
@@ -113,15 +113,15 @@ and they named the branch `idea` locally,
113
113
then pushed that branch.
114
114
We now have access to those changes as ` origin/idea ` .
115
115
116
- ![ ] ( ../artwork/diagrams/remote-story2.eps )
116
+ ![ ] ( ../artwork/diagrams/remote-story2.svg )
117
117
118
118
We look at the ` idea ` branch and like where they're going with it,
119
119
but we also want the changes they've made on their ` master ` branch,
120
120
so we do a 3-way merge of their two branches and our ` master ` .
121
121
We don't know how well this is going to work,
122
122
so we make a ` tryidea ` branch first and then do the merge there.
123
123
124
- ![ ] ( ../artwork/diagrams/remote-story3.eps )
124
+ ![ ] ( ../artwork/diagrams/remote-story3.svg )
125
125
126
126
Now we can run our tests
127
127
and merge everything back into our ` master ` branch if we want.
@@ -145,7 +145,7 @@ creating a new merge commit.
145
145
(All commits that are simply merges
146
146
are given a darker color in this example)
147
147
148
- ![ ] ( ../artwork/diagrams/rebase1.eps )
148
+ ![ ] ( ../artwork/diagrams/rebase1.svg )
149
149
150
150
At this point,
151
151
you both do work and commit changes
@@ -154,7 +154,7 @@ Then she does another commit and you fetch and merge once more.
154
154
At this point,
155
155
you'll have a commit history that looks something like this:
156
156
157
- ![ ] ( ../artwork/diagrams/rebase2.eps )
157
+ ![ ] ( ../artwork/diagrams/rebase2.svg )
158
158
159
159
Perfectly fine,
160
160
but it can get a little confusing
@@ -181,7 +181,7 @@ since nothing points to them,
181
181
when you run the garbage collection tools
182
182
(see "The Care and Feeding of Git" section).
183
183
184
- ![ ] ( ../artwork/diagrams/rebase3.eps )
184
+ ![ ] ( ../artwork/diagrams/rebase3.svg )
185
185
186
186
So let's see what happens
187
187
if we rebase rather than merge in the same scenario.
@@ -198,22 +198,22 @@ You'll notice that now it looks like she cloned you and committed
198
198
and then you changed that code,
199
199
rather than you both working at the same time and merging.
200
200
201
- ![ ] ( ../artwork/diagrams/rebase4.eps )
201
+ ![ ] ( ../artwork/diagrams/rebase4.svg )
202
202
203
203
At this point,
204
204
instead of merging two more times like we did originally,
205
205
we rebase the next two commits she makes.
206
206
207
- ![ ] ( ../artwork/diagrams/rebase5.eps )
207
+ ![ ] ( ../artwork/diagrams/rebase5.svg )
208
208
209
- ![ ] ( ../artwork/diagrams/rebase6.eps )
209
+ ![ ] ( ../artwork/diagrams/rebase6.svg )
210
210
211
211
And finally,
212
212
we are left with a commit history that looks like Figure 1,
213
213
rather than Figure 2,
214
214
which is what we would have if we had merged instead.
215
215
216
- ![ ] ( ../artwork/diagrams/rebase7-final.eps )
216
+ ![ ] ( ../artwork/diagrams/rebase7-final.svg )
217
217
218
218
> ** NOTE** \
219
219
You should remember to only do this on local branches before you push
0 commit comments