0

I want to find all the files changed in a branch from the time of creation of branch. Challenge is branch might or might not be merged in master or merged at certain time but not recently.

What I trying to find is not how much that branch is ahead of master.

Also NOT what files are different from Master.

What I need is all the files changes in branch from the time branch is created(whether or not merged in master). If I can find all the commits in branch that will also suffice.

I tried git commits on a specific branch but all answers are picking starting commit after merge with master.

Also tried :

git diff --name-status master...origin/feature/fname

but again files those are files different from master not all the files changes in the current branch since branch is created(e.g. branch is merged from master in between or took latest from master so only new files after merge/pull are available not all changed files in that branch).

Requirement is all the files changed by user in all the commits in feature branch whether they are different from master or not.

EDIT: I have clearly tried accepted solution from Is there a way to see all changed files on a branch in Git? with three dots,already mentioned.

It is not duplicate since I don't want files changed from master. This solution break when someone merge changes to master then this solution shows this feature changed no files but that is not true. Also if I merge intermediate or more than one time in master results for files changed in feature branch are inconsistent & false.

Pranav Singh
  • 17,079
  • 30
  • 77
  • 104
  • 1
    Possible duplicate of [Is there a way to see all changed files on a branch in Git?](https://stackoverflow.com/questions/6913263/is-there-a-way-to-see-all-changed-files-on-a-branch-in-git) – Liam May 17 '19 at 08:41
  • @Liam tried this one earlier too & now also. Not solving this issue, I have explained again in detail for the reason why this is not duplicate – Pranav Singh May 17 '19 at 09:00
  • 1
    if you notice the answer on the duplicate flag above, `git diff --name-only master...foo`, you can use commit hash instead of branch name. for example, `git diff-tree --name-only ac8c81cc..821fbdd1`. there are [tons of flags](https://git-scm.com/docs/git-diff-tree) you can play with. hence this question is dupes. – Bagus Tesa May 17 '19 at 09:01
  • @BagusTesa What I doing will be dynamic for any feature branch & have to be integrated in CI/CD for some deployment requirement. So I don't know two commits in advance I have to find for given feature branch selected by user as needed. So again I tried "git commits on a specific branch" & finding initial & last commit for same but merge scenario explained above break all solutions – Pranav Singh May 17 '19 at 09:07
  • Possible duplicate of [How to find out what files were changed in a git branch (not the difference between two branches)](https://stackoverflow.com/questions/29702692/how-to-find-out-what-files-were-changed-in-a-git-branch-not-the-difference-betw) – phd May 17 '19 at 12:33

0 Answers0