Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git - get only changed files from specific commit

Tags:

git

Let's imagine tree something like this:

       d---g---i           feature 1
      /         \
     /   c---f   \         feature 2
    /   /     \   \
---a---b---e---h---j---n   master
            \         
             k---l---m     feature 3

In this repository, there are mix of files (sql, xml, dll...). Now, I would like to list only changed (or added) files from features 1 and 2 and 3 (well, feature 3 is not finished, but I need to take changed scripts and apply it to some customer to test it). I really need only changed files, because reapplying all scripts from whole repository to the customer is not possible.

like image 290
David Avatar asked Mar 26 '26 12:03

David


1 Answers

Each commit is a complete snapshot of the repository.

so git diff h m will give you the raw difference between the two commits h and m, nothing but changes between the two.

Combine this with --stat or --name-only to get the files that are changed.

like image 75
prahlad venkata Avatar answered Mar 29 '26 09:03

prahlad venkata