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

  • SEARCH
  • Home
  • 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 7612955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:02:53+00:00 2026-05-31T02:02:53+00:00

The command git show –pretty=format: –name-status bd61ad98 will show a list of all the

  • 0

The command git show --pretty="format:" --name-status bd61ad98 will show a list of all the files modified/added/deleted in the last commit where bd61ad98 is the commit ID. The output looks like this:

[trusktr@rocketship express.git]$ git show --pretty="format:" --name-status bd61ad98

A       test.txt
D       test3.txt
M       wp-atom.php

What about a command that shows the same information but for all the commits from the last push? FOr example, if a file was deleted (D), then re-added (A), then modified (M), the ideal status would be M for modified. In other words, the net effect is that the file was modified.

Is there any such command? Even if the command were to list the duplicate statuses for files, that’d be fine. I could write a script that can determine the net effect.

Perhaps there’s a way to compare diffs and output a list of files modified/deleted/added?

The reason I need such a file is that I’m making a script that will update another location using FTP based on this info.

  • 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-05-31T02:02:54+00:00Added an answer on May 31, 2026 at 2:02 am

    You really want git diff-tree; see my other answer to your other question, too. 🙂

    Edit for details:

    git diff-tree -r [other options] commit1 [commit2]
    

    will give you the changes (in the formats documented for git-diff-tree) made either between commit1 and (I think) its immediate parent (if commit2 is omitted), or between commit1 and commit2.

    You can also give it an actual tree-ID but then you must give it both tree IDs since it will not be able to find the parent, e.g.:

    git diff-tree -r 69d8f48dd3e69f228b9a727cc69f8fbaf4534b4f
    error: Object 69d8f48dd3e69f228b9a727cc69f8fbaf4534b4f is a tree, not a commit
    

    (obviously the ID will vary).

    If you have a branch name that refers to “what we last sent out”, e.g., branch THEYHAVE, and you want to send them what’s on branch TESTED, you could do:

    git diff-tree -r THEYHAVE TESTED |
        while read omode nmode ohash nhash letter pathname; do
            ...
        done
    

    and use the various letter codes and values in $nhash and so on to extract the files (“git cat-file -p $nhash” will get you the contents of the file even in a --bare repo).

    (You can simplify this with --name-status for your case, probably.)

    Once you have everything FTP-ed to where it should go, you can then use git update-ref to move the branch-label THEYHAVE to whatever the branch named TESTED names (it might be a good idea to use git rev-parse once to grab the ID of that branch “up front”, in case it moves while you’re doing all this work).

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

Sidebar

Related Questions

What is the svn equivalent of this command, basically? git show -s --pretty=format:%an 85c3e0
Is there command which can show me list of all available commands in GIT?
I'm looking for a command in git-svn that will show me the changes I
I mistakenly added files to Git using the command: git add myfile.txt I have
Is there a way to use a command like git ls-files to show only
I don't know how to list all command or subprogram that the git project
When I say git status I get a list of changed files. I'd like
I'm looking at output of git show --numstat --shortstat --raw --pretty=medium -p command and
Is there a clearcase command to show me say all the files and the
What's the git equivalent of svn status -u or more verbose svn status --show-updates

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.