Skip to content

Commit f01b56b

Browse files
committed
fix image paths
1 parent 9591986 commit f01b56b

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

book/07-git-tools/sections/other-helpers.asc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ end
175175

176176
In one branch we change the word ``hello'' to ``hola'', then in another branch we change the ``world'' to ``mundo''.
177177

178-
image::../images/rerere1.png[]
178+
image::images/rerere1.png[]
179179

180180
When we merge the two branches together, we'll get a merge conflict:
181181

@@ -277,7 +277,7 @@ Recorded resolution for 'hello.rb'.
277277

278278
You can see that it "Recorded resolution for FILE".
279279

280-
image::../images/rerere2.png[]
280+
image::images/rerere2.png[]
281281

282282
Now, let's undo that merge and then rebase it on top of our master branch instead. We can move our branch back by using `reset` as we saw in <<_reset>>.
283283

@@ -337,7 +337,7 @@ index a440db6,54336ba..0000000
337337
end
338338
----
339339

340-
image::../images/rerere3.png[]
340+
image::images/rerere3.png[]
341341

342342
You can also recreate the conflicted file state with the `checkout` command:
343343

book/07-git-tools/sections/replace.asc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ c1822cf first commit
2222

2323
We want to break this up into two lines of history. One line goes from commit one to commit four - that will be the historical one. The second line will just be commits four and five - that will be the recent history.
2424

25-
image::../images/replace1.png[]
25+
image::images/replace1.png[]
2626

2727
Well, creating the historical history is easy, we can just put a branch in the history and then push that branch to the master branch of a new remote repository.
2828

@@ -37,7 +37,7 @@ c6e1e95 (history) fourth commit
3737
c1822cf first commit
3838
----
3939

40-
image::../images/replace2.png[]
40+
image::images/replace2.png[]
4141

4242
Now we can push the new `history` branch to the `master` branch of our new repository:
4343

@@ -82,7 +82,7 @@ $ echo 'get history from blah blah blah' | git commit-tree 9c68fdc^{tree}
8282
The `commit-tree` command is one of a set of commands that are commonly referred to as 'plumbing' commands. These are commands that are not generally meant to be used directly, but instead are used by **other** Git commands to do smaller jobs. On occasions when we're doing weirder things like this, they allow us to do really low-level things but are not meant for daily use. You can read more about plumbing commands in <<_plumbing>>
8383
=====
8484

85-
image::../images/replace3.png[]
85+
image::images/replace3.png[]
8686

8787
OK, so now that we have a base commit, we can rebase the rest of our history on top of that with `git rebase --onto`. The `--onto` argument will be the SHA we just got back from `commit-tree` and the rebase point will be the third commit (the parent of the first commit we want to keep, `9c68fdc`):
8888

@@ -94,7 +94,7 @@ Applying: fourth commit
9494
Applying: fifth commit
9595
----
9696

97-
image::../images/replace4.png[]
97+
image::images/replace4.png[]
9898

9999
OK, so now we've re-written our recent history on top of a throw away base commit that now has instructions in it on how to reconstitute the entire history if we wanted to. We can push that new history to a new project and now when people clone that repository, they will only see the most recent two commits and then a base commit with instructions.
100100

@@ -154,7 +154,7 @@ c1822cf first commit
154154

155155
Cool, right? Without having to change all the SHAs upstream, we were able to replace one commit in our history with an entirely different commit and all the normal tools (`bisect`, `blame`, etc) will work how we would expect them to.
156156

157-
image::../images/replace5.png[]
157+
image::images/replace5.png[]
158158

159159
Interestingly, it still shows `81a708d` as the SHA, even though it's actually using the `c6e1e95` commit data that we replaced it with. Even if you run a command like `cat-file`, it will show you the replaced data:
160160

book/07-git-tools/sections/reset.asc

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,42 +90,42 @@ $ tree
9090

9191
Git's main purpose is to record snapshots of your project in successively better states, by manipulating these three trees.
9292

93-
image::../images/reset-workflow.png[]
93+
image::images/reset-workflow.png[]
9494

9595
Let's visualize this process: say you go into a new directory with a single file in it.
9696
We'll call this *v1* of the file, and we'll indicate it in blue.
9797
Now we run `git init`, which will create a Git repository with a HEAD reference which points to an unborn branch (`master` doesn't exist yet).
9898

99-
image::../images/reset-ex1.png[]
99+
image::images/reset-ex1.png[]
100100

101101
At this point, only the Working Directory tree has any content.
102102

103103
Now we want to commit this file, so we use `git add` to take content in the Working Directory and copy it to the Index.
104104

105-
image::../images/reset-ex2.png[]
105+
image::images/reset-ex2.png[]
106106

107107
Then we run `git commit`, which takes the contents of the Index and saves it as a permanent snapshot, creates a commit object which points to that snapshot, and updates `master` to point to that commit.
108108

109-
image::../images/reset-ex3.png[]
109+
image::images/reset-ex3.png[]
110110

111111
If we run `git status`, we'll see no changes, because all three trees are the same.
112112

113113
Now we want to make a change to that file and commit it.
114114
We'll go through the same process; first we change the file in our working directory.
115115
Let's call this *v2* of the file, and indicate it in red.
116116

117-
image::../images/reset-ex4.png[]
117+
image::images/reset-ex4.png[]
118118

119119
If we run `git status` right now, we'll see the file in red as ``Changes not staged for commit,'' because that entry differs between the Index and the Working Directory.
120120
Next we run `git add` on it to stage it into our Index.
121121

122-
image::../images/reset-ex5.png[]
122+
image::images/reset-ex5.png[]
123123

124124
At this point if we run `git status` we will see the file in green
125125
under ``Changes to be committed'' because the Index and HEAD differ – that is, our proposed next commit is now different from our last commit.
126126
Finally, we run `git commit` to finalize the commit.
127127

128-
image::../images/reset-ex6.png[]
128+
image::images/reset-ex6.png[]
129129

130130
Now `git status` will give us no output, because all three trees are the same again.
131131

@@ -138,7 +138,7 @@ The `reset` command makes more sense when viewed in this context.
138138

139139
For the purposes of these examples, let's say that we've modified `file.txt` again and committed it a third time. So now our history looks like this:
140140

141-
image::../images/reset-start.png[]
141+
image::images/reset-start.png[]
142142

143143
Let's now walk through exactly what `reset` does when you call it. It directly manipulates these three trees in a simple and predictable way.
144144
It does up to three basic operations.
@@ -149,7 +149,7 @@ The first thing `reset` will do is move what HEAD points to.
149149
This isn't the same as changing HEAD itself (which is what `checkout` does); `reset` moves the branch that HEAD is pointing to.
150150
This means if HEAD is set to the `master` branch (ie, you're currently on the `master` branch), running `git reset 9e5e64a` will start by making `master` point to `9e5e64a`.
151151

152-
image::../images/reset-soft.png[]
152+
image::images/reset-soft.png[]
153153

154154
No matter what form of `reset` with a commit you invoke, this is the first thing it will always try to do.
155155
With `reset --soft`, it will simply stop there.
@@ -165,7 +165,7 @@ Note that if you run `git status` now you'll see in green the difference between
165165

166166
The next thing `reset` will do is to update the Index with the contents of whatever snapshot HEAD now points to.
167167

168-
image::../images/reset-mixed.png[]
168+
image::images/reset-mixed.png[]
169169

170170
If you specify the `--mixed` option, `reset` will stop at this point.
171171
This is also the default, so if you specify no option at all, this is where the command will stop.
@@ -178,7 +178,7 @@ You rolled back to before you ran all your `git add` and `git commit` commands.
178178
The third thing that `reset` will do is to make the Working Directory look like the Index.
179179
If you use the `--hard` option, it will continue to this stage.
180180

181-
image::../images/reset-hard.png[]
181+
image::images/reset-hard.png[]
182182

183183
So let's think about what just happened.
184184
You undid your last commit, the `git add` and `git commit` commands, **and** all the work you did in your working directory.
@@ -210,20 +210,20 @@ This form (since you did not specify a commit SHA or branch, and you didn't spec
210210

211211
So it essentially just copies `file.txt` from HEAD to the Index.
212212

213-
image::../images/reset-path1.png[]
213+
image::images/reset-path1.png[]
214214

215215
This has the practical effect of _unstaging_ the file.
216216
If we look at the diagram for that command and think about what `git add` does, they are exact opposites.
217217

218-
image::../images/reset-path2.png[]
218+
image::images/reset-path2.png[]
219219

220220
This is why the output of the `git status` command suggests that you run this to unstage a file.
221221
(See <<_unstaging>> for more on this.)
222222

223223
We could just as easily not let Git assume we meant ``pull the data from HEAD'' by specifying a specific commit to pull that file version from.
224224
We would just run something like `git reset eb43bf file.txt`.
225225

226-
image::../images/reset-path3.png[]
226+
image::images/reset-path3.png[]
227227

228228
This effectively does the same thing as if we had reverted the content of the file to *v1* in the Working Directory, ran `git add` on it, then reverted it back to *v3* again (without actually going through all those steps).
229229
If we run `git commit` now, it will record a change that reverts that file back to *v1*, even though we never actually had it in our Working Directory again.
@@ -242,15 +242,15 @@ You can use `reset` to quickly and easily squash them into a single commit that
242242
Let's say you have a project where the first commit has one file, the second commit added a new file and changed the first, and the third commit changed the first file again.
243243
The second commit was a work in progress and you want to squash it down.
244244

245-
image::../images/reset-squash-r1.png[]
245+
image::images/reset-squash-r1.png[]
246246

247247
You can run `git reset --soft HEAD~2` to move the HEAD branch back to an older commit (the first commit you want to keep):
248248

249-
image::../images/reset-squash-r2.png[]
249+
image::images/reset-squash-r2.png[]
250250

251251
And then simply run `git commit` again:
252252

253-
image::../images/reset-squash-r3.png[]
253+
image::images/reset-squash-r3.png[]
254254

255255
Now you can see that your reachable history, the history you would push, now looks like you had one commit with `file-a.txt` v1, then a second that both modified `file-a.txt` to v2 and added `file-b.txt`.
256256

@@ -279,7 +279,7 @@ HEAD will now point to `master`.
279279
So, in both cases we're moving HEAD to point to commit A, but _how_ we do so is very different.
280280
`reset` will move the branch HEAD points to, `checkout` moves HEAD itself.
281281

282-
image::../images/reset-checkout.png[]
282+
image::images/reset-checkout.png[]
283283

284284
===== With Paths
285285

book/07-git-tools/sections/revision-selection.asc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ For example, say you have a commit history that looks like <<double_dot>>.
265265

266266
[[double_dot]]
267267
.Example history for range selection.
268-
image::../images/double-dot.png[Example history for range selection.]
268+
image::images/double-dot.png[Example history for range selection.]
269269

270270
You want to see what is in your experiment branch that hasn’t yet been merged into your master branch.
271271
You can ask Git to show you a log of just those commits with `master..experiment` – that means ``all commits reachable by experiment that aren’t reachable by master.''

book/07-git-tools/sections/undoing-merges.asc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Merge commits are no different.
88
Let's say you started work on a topic branch, accidentally merged it into `master`, and now your commit history looks like this:
99

1010
.Accidental merge commit
11-
image::../images/undomerge-start.png[Accidental merge commit.]
11+
image::images/undomerge-start.png[Accidental merge commit.]
1212

1313
There are two ways to approach this problem, depending on what your desired outcome is.
1414

@@ -18,7 +18,7 @@ If the unwanted merge commit only exists on your local repository, the easiest a
1818
In most cases, if you follow the errant `git merge` with `git reset --merge ORIG_HEAD`, this will reset the branch pointers so they look like this:
1919

2020
.History after `git reset --merge`
21-
image::../images/undomerge-reset.png[History after `git reset --merge`.]
21+
image::images/undomerge-reset.png[History after `git reset --merge`.]
2222

2323
We covered `reset` back in <<_reset>>, so it shouldn't be too hard to figure out what's going on here.
2424
Here's a quick refresher: `reset --hard` usually goes through three steps:
@@ -52,7 +52,7 @@ In this case, we want to undo all the changes introduced by merging in parent #2
5252
The history with the revert commit looks like this:
5353

5454
.History after `git revert -m 1`
55-
image::../images/undomerge-revert.png[History after `git revert -m 1`.]
55+
image::images/undomerge-revert.png[History after `git revert -m 1`.]
5656

5757
The new commit `^M` has exactly the same contents as `C6`, so starting from here it's as if the merge never happened, except that the now-unmerged commits are still in `HEAD`'s history.
5858
Git will get confused if you try to merge `topic` into `master` again:
@@ -67,7 +67,7 @@ There's nothing in `topic` that isn't already reachable from `master`.
6767
What's worse, if you add work to `topic` and merge again, Git will only bring in the changes _since_ the reverted merge:
6868

6969
.History with a bad merge
70-
image::../images/undomerge-revert2.png[History with a bad merge.]
70+
image::images/undomerge-revert2.png[History with a bad merge.]
7171

7272
The best way around this is to un-revert the original merge, since now you want to bring in the changes that were reverted out, *then* create a new merge commit:
7373

@@ -79,7 +79,7 @@ $ git merge topic
7979
----
8080

8181
.History after re-merging a reverted merge
82-
image::../images/undomerge-revert3.png[History after re-merging a reverted merge.]
82+
image::images/undomerge-revert3.png[History after re-merging a reverted merge.]
8383

8484
In this example, `M` and `^M` cancel out.
8585
`^^M` effectively merges in the changes from `C3` and `C4`, and `C8` merges in the changes from `C7`, so now `topic` is fully merged.

0 commit comments

Comments
 (0)