-
Notifications
You must be signed in to change notification settings - Fork 2k
git cat-file -p master^{tree} in other shells #1011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
The `master^{tree}` syntax specifies the tree object that is pointed to by the last commit on your `master` branch. | ||
Notice that the `lib` subdirectory isn't a blob but a pointer to another tree: | ||
|
||
**NOTE**: while using `master^{tree}` syntax if you have error try the following |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of just setting this in bold-face, let's use the Asciidoc "note" feature:
[NOTE]
====
(Note content goes here)
====
This will render much nicer.
In addition, let's change the prose here to read like this:
Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax.
In PowerShell or CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p master^^{tree}`.
If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"`.
Or something like that. It's a bit more idiomatically English.
NOTE heading style changed and its content rephrased
==== | ||
* Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax | ||
* In PowerShell or CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p mater^^{tree}` | ||
* If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
list converted to single paragraph
|
||
[NOTE] | ||
==== | ||
Depending on what shell you use, you may encounter errors when using the `master^{tree}` syntax. In PowerShell or CMD on Windows, the `^` character is used for escaping, so you have to double it to avoid this: `git cat-file -p mater^^{tree}`. If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, one more request: could you reformat this with one sentence on each source-code line? It makes reviewing PRs much easier in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure no problem
changed to one sentence on each source-code line
If you're using ZSH, the `^` character is used for globbing, so you have to enclose the whole expression in quotes: `git cat-file -p "master^{tree}"` | ||
==== | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure no problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hope these formatting rules are defined somewhere so that people could just read and follow it.
note block moved below code block
usage of
git cat-file -p master^{tree} command
in other environments as specified in this answer https://stackoverflow.com/a/17121954/2445295 thanks to @Mellbourn