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/10-git-internals/sections/objects.asc
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -381,12 +381,13 @@ You can calculate the SHA-1 value of a string in Ruby by including the SHA1 dige
381
381
=> "bd9dbf5aae1a3862dd1526723246b20206e5fc37"
382
382
----
383
383
384
-
Let's validate the hash with `git hash-object`. It shows that they are identical. Note that `echo` will add a trailing newline character in string, which is not we want in this case. `echo -n` can prevent from adding a trailing newline character.
384
+
Let's compare that to the output of `git hash-object`.
385
+
Here we use `echo -n` to prevent adding a newline to the input.
0 commit comments