Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9047545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:56:13+00:00 2026-06-16T11:56:13+00:00

The command git show is extremely useful, including for listing directories, but its output

  • 0

The command git show is extremely useful, including for listing directories, but its output in listing a directory causes some problems. For example, consider the following.

user@machine$ git show HEAD:src/
tree HEAD:src/

file0
dir0/
file1
etc/
...

The problem, here, is that it prints tree HEAD:src/ and a blank line. I could easily split on the blank line, and take only the directory listing, but this seems needlessly complex. I cannot use any other system tools, like tr or similar. I can only use git.

Thank you all!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:56:15+00:00Added an answer on June 16, 2026 at 11:56 am

    Try ls-tree command instead:

    git ls-tree -r --name-only HEAD src/
    

    -r instructs ls-tree to be recursive and --name-only simplifies output.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking at output of git show --numstat --shortstat --raw --pretty=medium -p command and
I'm looking for a command in git-svn that will show me the changes I
Here is my try : #!/Usr/bin/emacs --script (let ((default-directory /home/vision)) (shell-command git pull;) but
Is there a way to use a command like git ls-files to show only
The command git show --pretty=format: --name-status bd61ad98 will show a list of all the
What is the svn equivalent of this command, basically? git show -s --pretty=format:%an 85c3e0
When using this command: $ git show -s --pretty=format:%H --all it prints this: 41b253549d86db3432743c1c8a9f75511779073c
The following git command... git show -s --pretty=format:%T master ...will emit the SHA1 of
In Git, there is the command git remote show <remote> When properly configured, this
I want the git show command to send the contents of the file to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.