Last active
January 19, 2026 14:39
-
-
Save petergi/9777350324e257687232c528d97eec58 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Try to show the contents of docs/ from the master branch. | |
| # - git show works for files, but may fail for directories. | |
| # - Suppress errors and limit output to 20 lines. | |
| # - If that fails, fall back to listing files under docs/ instead. | |
| # - Always show only the first 20 results to keep output predictable. | |
| git show master:docs/ 2>/dev/null | head -20 \ | |
| || git ls-tree -r master --name-only | grep '^docs/' | head -20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment