Skip to content

Commit c12d93d

Browse files
authored
git cat-file -p master^{tree} in other shells
usage of git cat-file -p master^{tree} command in other shells as specified in this answer https://stackoverflow.com/a/17121954/2445295 thanks to @Mellbourn
1 parent 85eba6e commit c12d93d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

book/10-git-internals/sections/objects.asc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ $ git cat-file -p master^{tree}
139139
The `master^{tree}` syntax specifies the tree object that is pointed to by the last commit on your `master` branch.
140140
Notice that the `lib` subdirectory isn't a blob but a pointer to another tree:
141141

142+
**NOTE**: while using `master^{tree}` syntax if you have error try the following
143+
144+
* On Windows, in PowerShell and cmd.exe, ^ is used for escaping. There, you can alternatively write git `cat-file -p master^^{tree}`
145+
* In zsh `^` is a globbing character so use them with quotes `git cat-file -p "master^{tree}"`
146+
* In bash the command works without quotes
147+
142148
[source,console]
143149
----
144150
$ git cat-file -p 99f1a6d12cb4b6f19c8655fca46c3ecf317074e0

0 commit comments

Comments
 (0)